how do I delay this code so that the div will refresh 2 seconds later.
$(".it").load(“collect.php .it”);
$(".pays").load(“collect.php .pays”);
$(".more").load(“collect.php .more”);
how do I delay this code so that the div will refresh 2 seconds later.
$(".it").load(“collect.php .it”);
$(".pays").load(“collect.php .pays”);
$(".more").load(“collect.php .more”);
Hopefully the following will help you out.
Inline version for small amounts of code:
setTimeout(function() { alert('rawr'); },2000);
//or
setTimeout("echo('yay!!');",2000);
Expanded version for more complex code:
function updateDiv()
{
//something to happen 2 seconds after stuff #1
//some more stuff to do
}
//do some stuff #1
setTimeout("updateDiv()",2000);