I want to ping the server every 2 minutes using jQuery. I thought about an open loop with setTimeout function but I think this would crush the browser - any suggestions ?
Do not use setTimeout() for this type of action, rather use setInterval().
var intervalId = setInterval(function() { /* Do your magic */ }, 2000);
To clear your interval, simply clearInterval(intervalId), when you wish to stop the ping:ing.
clearInterval(intervalId)