Details
Description
if you use the javascript: protocol in the href attribute of an anchor, it causes an ICEfaces page running in IE to stop working. If you move the code into the onclick of the anchor, it seems to be okay - this is the suggested workaround. Here's a snippet from the test case to illustrate:
This is bad:
<a href="javascript:stay();">Stay (via javascript: from href)</a> (this one triggers onbeforeunload with IE)<br/>
This is okay (of course you don't need to use the javascript: protocol if you use the onclick handler):
<a onclick="stay();" href="#">Stay (via onclick)</a> <br/>
If your actions in the script triggered event actually causes you to leave the page, the event fires twice in IE:
<a href="javascript:leave();">Leave (via javascript: from href)</a><br/>
The problem is that use of the javascript: protocol in IE triggers the beforeunload event to fire (but not the unload event). The ICEfaces JavaScript bridge relies on the event to do some cleanup operations. Because the bridge gets cleaned up, further action on the page will not work.
This is bad:
<a href="javascript:stay();">Stay (via javascript: from href)</a> (this one triggers onbeforeunload with IE)<br/>
This is okay (of course you don't need to use the javascript: protocol if you use the onclick handler):
<a onclick="stay();" href="#">Stay (via onclick)</a> <br/>
If your actions in the script triggered event actually causes you to leave the page, the event fires twice in IE:
<a href="javascript:leave();">Leave (via javascript: from href)</a><br/>
The problem is that use of the javascript: protocol in IE triggers the beforeunload event to fire (but not the unload event). The ICEfaces JavaScript bridge relies on the event to do some cleanup operations. Because the bridge gets cleaned up, further action on the page will not work.
Issue Links
Activity
- All
- Comments
- History
- Activity
- Remote Attachments
- Subversion