jemz — 2013-05-31T16:05:37-04:00 — #1
I am having trouble how do i use the delay before sending a request,what i want is to delay about 3secs to show my loading bar and make a request to server.
i tried this
<div><img src="loadingbar.gif"></img></div>.delay(3); //3 seconds.
Thank you in advance
pullo — 2013-05-31T16:21:44-04:00 — #2
Unfortunately, you cannot call
delay() on random HTML
In this case, just use setTimeout:
// Server request here
Hope that helps.
jemz — 2013-06-01T02:36:06-04:00 — #3
Hi Pullo, Thank you so much it's working
I have some question about when do we use beforeSend() ?..i thought this is use by some website that i had seen that will display something like this "please wait...." when we submit some forms to the server...so in my point of view of this did they also used setTimeout ?please correct me if i am wrong.
pullo — 2013-06-01T07:38:42-04:00 — #4
If you do something like:
The jQuery will call the
beforeSend function, before making the GET request, but it will not wait for it to finish.
jemz — 2013-06-01T10:08:42-04:00 — #5
Thank you pullo for enlighten my mind