I have a function that sets display=none on a table row. At the end of my function I want to set a timeout to hide the next table row after a few milliseconds.
I have a problem though. When the timeout expires, the page is reloaded (undoing the effects of my function and and scrolling to page top). This even happens if I use an empty timeout: window.SetTimeout(function () { ; }, 1000); How can I stop this happening?
I am using recent Chromium.
I think your problem is somewhere else, disregarding the obvious error that you cased
SetTimeoutwrong ( it should besetTimeout).There is nothing in your code that should refresh the page.
Edit:
Just thought of something, since you cased
SetTimeoutwrong, maybe your click handler doesn’t finish as it should, thus letting the link “pass through” and load the page.Edit2:
Huh, thats not the case….
http://jsfiddle.net/eGhQM/6/
Edit3:
…and maybe it is(x-something error on fiddle though)
http://jsfiddle.net/eGhQM/9/