How would you automatically restart a javascript application when it crashes?

449 views Asked by At

I am interested in running a slideshow in an unattended web browser. I would rather it didn't crash. How should I make sure the javascript application continues to run or the browser reloads the home page when it crashes?

1

There are 1 answers

0
jishi On BEST ANSWER

Prepare a frameset with one hidden frame, and your actual content frame as the other. Have a setTimeout running continuously in the hidden frame, which gets reset by the "content" frame from time to time. Lets say that the setTimeout in the hidden frame is 20 seconds, have the content frame reset that timeout (clearTimeout) every 10 seconds or so. If no reset is received (content frame has crashed), force reload the content frame from the hidden frame.