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
Deryk Sinotte
created issue -
Deryk Sinotte
made changes -
Field | Original Value | New Value |
---|---|---|
Support Case References |
https://www.icesoft.ca:4443/supportilla/show_bug.cgi?id=4552 |
|
Assignee | Deryk Sinotte [ deryk.sinotte ] |
Deryk Sinotte
made changes -
Attachment | js.html [ 11214 ] |
Deryk Sinotte
made changes -
Deryk Sinotte
made changes -
Deryk Sinotte
made changes -
Status | Open [ 1 ] | Resolved [ 5 ] |
Fix Version/s | 1.7.2 [ 10130 ] | |
Resolution | Won't Fix [ 2 ] |
Ken Fyten
made changes -
Status | Resolved [ 5 ] | Closed [ 6 ] |
Assignee | Deryk Sinotte [ deryk.sinotte ] |
A simple test case that shows the how the onbeforeunload event is fired in IE when using the the javascript: protocol in the href attribute of an anchor tag.