Skip to content Skip to sidebar Skip to footer

Problems With Jquery Load()

I need a certain div refreshed on the page every 3 seconds. This div contains other divs inside it. <

Solution 1:

Do you just need to keep the query string on find.php? Something like:

    setInterval(function(){
        $('#gamewrapper2').load(window.location.pathname + window.location.search + ' #gamewrapper2');
    }, 3000);

Solution 2:

You can try the following to pass variables into the php document:

setInterval(function()
{
    $('#gamewrapper2').load('find.php #gamewrapper2', {id: 1000001});
}, 3000);
}

Additionally, you can provide a function callback when it has completed loading to perform some task...

setInterval(function()
{
    $('#gamewrapper2').load('find.php #gamewrapper2', {id: 1000001}, function(){
        alert("find.php has been loaded.");
    });
}, 3000);
}

.load() method

You should probably use $_POST['id'] to get the value from find.php.

Post a Comment for "Problems With Jquery Load()"