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
Unfortunately, you cannot call
delay() on random HTML
In this case, just use setTimeout:
// Server request here
Hope that helps.
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.
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.
Thank you pullo for enlighten my mind
This topic is now closed. New replies are no longer allowed.