Friday, 12 May 2017

How to load specific part or page

How to load specific part or page



page.html

<div id="product82">
    <span class="sku">sku-3</span>
    <span class="brand">Test Brand 1</span>
    <span class="avail">Test Content 1</span>
</div>
<div id="product83">
    <span class="sku">sku-4</span>
    <span class="brand">Test Brand 2</span>
    <span class="avail">Test Content 2</span>
</div>
<div id="product84">
    <span class="sku">sku-5</span>
    <span class="brand">Test Brand 3</span>
    <span class="avail">Test Content 3</span>
</div>


Script :

<script>
    $('.mycontainer').load('http://www.yourpageurl.com/page.html #product83 .avail');
</script>


Html :

<div class="mycontainer"></div>

This script will load external page content in our . div and result will

<div class="mycontainer">
    <span class="avail">Test Content 2</span>
</div>



banner
Previous Post
Next Post

0 comments: