Internet Explorer calling [removed] on window.open and AJAX calls

后端 未结 8 1498
刺人心
刺人心 2021-01-04 11:21

Ok, I have spent a while on this problem and this is what I have gathered:

  1. If you make an AJAX call in IE7 and you have a window.onbeforeunload function spe

8条回答
  •  花落未央
    2021-01-04 11:45

    OK, I have been having this issue. I have a (rather messy) work around for it.

    In my case, I want to block navigation away sometimes, and not others.

    So, I am setting a flag on the window to tell me if I want it blocked. So where you are doing your window.open, just before that, do 'window.allowExit=true' then in the onbeforeunload, check for window.allowExit = true.

    I have the java script (SHowHelp) being kicked off from a link:

    HERE
    

    onbeforeunload is called BEFORE the ShowHelp, so i used the onclick to set the flag

    HERE
    

    Ugly as sin, but it seems to work!

提交回复
热议问题