SetTimeout() and ClearTimeout() to stop freezing of IE8 and dialog aobut scripts overruning
I have some 3rd party software where i can open nsites and run javascript. Because some sites make me stack overflow i ussed the trick wih Registry to modify Styles WRAD to FFFFFF.
Still some sites may do stack overflow due to DOM.
I thought on start of running each site i would do javascript: setTimeout("window.status='one';",10000);
then on then end i would like to clear it - my question is how to if this doesnt have any actual id? Will the usual clearTimeout() without anything inside do it fi开发者_C百科ne?
I do not think that window.clearTimeout() will do the trick.
However, the ressource ID is just a integer number. In Opera it is 1, in FireFox 2, in IE some large number. Check out using this script:
<script type="text/javascript">
var test = window.setTimeout(alert, 10000);
alert(test);
</script>
So if there is no chance to set a global variable for the timeout - you may just clear the intervals for each integer from 1 to 5.000.000 or so. That is, of course, not beautiful.
If this problem still is relevant for you: Would you mind to tell a bit more on the reasons around your problem?
精彩评论