I have a function which displays a gif until an rrs feed loads up. Is there a way so say: If the gif has been displayed for more than 30 seconds, do something like a popup on the screen?
Here is a function I put together... var x = 0; var y = 1; function timingex(){ x = x+y; var timer = setTimeout("timingex()", 1000); //document.RssForm.But.value = x if(x==10){ document.getElementById("result").innerHTML = '<br><center><img src="_graphics/404-logoA.jpg" alt="Error"></center><p>TNN RSS feed could not be loaded</p>'; document.getElementById("visibilityPrev").style.visibility = "hidden"; document.getElementById("visibilityNext").style.visibility = "hidden"; clearTimeout(timer); } } Code (markup): However this runs as soon as the page has been open 10 seconds. I have another function: function loading(){ document.getElementById("result").innerHTML = '<br><br><center><img src="_graphics/loading.gif" alt="Loading..."></center>'; } Code (markup): This opens up an image while the RSS feed is being loaded. Ideally, I want to be able to see if the image in the loading() function had been on the screen for more than a certain amount of time then run the timingex() function. How would I go about doing this?