If I kick off an ajax polling script that hit the server every 30 seconds or so... would it continue to run if a user browsed to another page on the site?
I think it depends on where the "every 30 second" call is happening.
If it's in the JS, then it will stop, but if it's being called on the server, it will keep going.
TIP: trying googling the answer before posting, you'll find that more times than not someone else somewhere has had the same request and posted an answer online.
Javascript is downloaded to and run on the client machine. So if you are repeating the call in the javascript every 30 seconds it will stop calling as soon as the user leaves the page (closes the browser, clicks on a link, types in a new address).
If your JS is calling a script on the server (PHP, ASP, C#,..etc) and the server script that is running in the background is doing the 30 second call then it will keep running in the background until it either times out or you phyically go on the machine and kill the process.
TIP: trying googling the answer before posting, you'll find that more times than not someone else somewhere has had the same request and posted an answer online.
----
I have recently been semi-converted to ensuring all my code (well most of it) works in both javascript and non-javascript enabled browsers
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.