-
Bug
-
Resolution: Fixed
-
Normal
-
7.0.2
-
Security Level: Jimmy
-
None
-
IE 10 or below
-
None
To reproduce the issue run the page below and click the first link "reproduce problem". the beforeUnload listener is called even though the page is not unloaded.
(Can also be reproduced in IE11 with IE10 emulation)
<zk> <window id="mainWin" width="100%" height="100%" > <script type="text/javascript"><![CDATA[ zk.afterMount(function () { zk.beforeUnload(function() { console.log("invoke beforeUnload") }) }); ]]></script> <vlayout> Click the links/button and check the JS console, the first link causes an onBeforeUnload event in the browser window when using IE10 or below (caused/not prevented by href="javascript:;" on the <a> component) <a label="reproduce problem" onClick='Clients.showNotification("response from server 1")'></a> <a label="workaround using href = #" onClick='Clients.showNotification("response from server 2")' href="#"></a> <label value="workaround using label" onClick='Clients.showNotification("response from server 3")' style="cursor: pointer; text-decoration: underline; color: blue;"/> <button label="workaround using button" onClick='Clients.showNotification("response from server 4")'/> </vlayout> </window> </zk>
The code example shows 3 workarounds using an onClick event that does not cause the problem.