jQuery Ajax Load

Replace element html with returned data
$("#statistics").load('car-sale.htm');
ExampleAjax load with static file
Source Code Expand
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>

<!-- Javascript -->
<script type="text/javascript">
$(document).ready(function (){
    $("#btn362").click(function(){
        $("#div361").load("/backend/data/car-sale.htm");    
    });
});
</script>

<!-- HTML -->
<a name="#ajax-load-with-static-file"></a>
<div id="example-section36">    
    <div>Car sale report</div>
    <div id="div361">Report pending...</div>
    <button id="btn362" type="button">Click to load car sale report</button>    
    &nbsp;<a href="/backend/data/car-sale.htm" target="_blank">Original car sale report</a>
</div>


Loading portion of a page
//load content within element id named 'september-report'
$("#statistics").load('car-sale.htm #september-report'); 
ExampleAjax load portion
Source Code Expand
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>

<!-- Javascript -->
<script type="text/javascript">
$(document).ready(function (){
    $("#btn372").click(function(){
        $("#div371").load("/backend/data/car-sale.htm #september");    
    });
});
</script>

<!-- HTML -->
<a name="#ajax-load-portion"></a>
<div id="example-section37">    
    <div>Car sale report(September)</div>
    <div id="div371">Report pending...</div>
    <button id="btn372" type="button">Click to load September car sale report</button>    
    &nbsp;<a href="/backend/data/car-sale.htm" target="_blank">Original car sale report</a>
</div>



comments powered by Disqus