javascript - IE8 What is tiggering beforeunload event -


i have issue problem in ie8, go figure.

i have anchor tag onclick attribute

<a href="javascript:void(0);" onclick="foo();">click me</a> 

and foo declared elsewhere:

<script type="javascript/text">      function foo(){        //do work        return false;      } </script> 

after foo called, onbeforeunload handler being executed, , have no idea why.

i have had other instances, if foo function not return false, triggers beforeunload event in ie, function returning false, still hits onbeforeunload handler , can't figure out why.

is there way find out triggering it. have viewed event object inside onbeforeunload handler, doesn't not seem give me , relevant info.

any ideas?

change to

<a href="#" onclick="return foo();">click me</a> 

or

<a href="#" onclick="foo();return false;">click me</a> 

Comments

Popular posts from this blog

apache - Add omitted ? to URLs -

redirect - bbPress Forum - rewrite to wwww.mysite prohibits login -

php - How can I stop spam on my custom forum/blog? -