it worked...." /> it worked...." /> it worked...."/>

waiting before do action use jquery

430 Views Asked by At

I use jquery version 1.3.2,

I want to use event "load" for load content of a page to "div".

I used: $("#div1").load("page1.php"); ---> it worked.

But i want before do event "load", it waiting about times.

it same: $("#div1").load("page1.php",{after: 5});

please tell me how to do, thank you very much...

4

There are 4 best solutions below

0
On

You can try delay plugin or take a look to more traditional approach

0
On

You could try to slow the server down in sending its response, e.g.

//sleep for 5 seconds before outputting stuff
sleep(5);
echo 'Now I\'ll talk!';
0
On

Using settimeout() would be the best and easiest way through.

0
On

Try this:

setTimeout(function() {
   $("#div1").load("page1.php");
}, 5000);