How to load external webpage in div using jquery

Last updated on February 14th, 2022 at 01:21 pm

Click to rate this tutorial!
[Total: 2 Average: 4]

Very simple tutorial on loading an external webpage content in to div using simple jQuery technique. Here i am using a php file that read a text file which is getting updated through a shell script.

We have a div with id links.

Here is the code

<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.5.2/jquery.min.js"></script>
<div id="links">Loading Links...</div>
<script type="text/javascript">
$(document).ready(function()
{
    var refreshId = setInterval( function()
    {
$('#links').load("read_all_link.php");
}, 6000);
});
</script>


The above script will read and load the webpage every 6 seconds.

Demo

Click to rate this tutorial!
[Total: 2 Average: 4]

Leave a Reply

Your email address will not be published.