javascript - window.onunload fires and then the user clicks stop -
here flow trying figure out.
- user hits page.
- user clicks link ,
onbeforeunload
,unload
fired. here getting rid of href in of links. - the page hangs little bit giving user chance hit stop button in browser.
- since page still on original page (not new page requested , stopped) hrefs still blank.
is there way of knowing if user clicks stop button , still on same page?
the way can think off top of head put settimeout in onbeforeunload
or unload
don't because there many variables still being messed up.
what ended doing this:
window.unload = function(){ var _href = $('selector').attr('href'); $('selector').attr('href', ''); settimeout(function(){ $('selector').attr('href', _href); }, 1500); }
Comments
Post a Comment