I am using JavaScript with jQuery. I have the following script to alert hi every 30 seconds.
$(document).ready( function() {
alert(\"hi\");
Well, there probably is a way of doing it in just one call..
setInterval(
(function x() {
alert('hi');
return x;
})(), 30000);
Another solution would be to use arguments.callee, but as it is now deprecated, it is generally not recommended to use it.
setInterval(
(function() {
alert('hi');
return arguments.callee;
})(), 30000);