Uploaded image for project: 'ZK'
  1. ZK
  2. ZK-2422

<a> component causes onbeforeUnload in IE<=10

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Normal
    • Resolution: Fixed
    • Affects Version/s: 7.0.2
    • Fix Version/s: 7.0.4
    • Component/s: Components
    • Security Level: Jimmy
    • Labels:
      None
    • Environment:

      IE 10 or below

      Description

      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 &lt;a&gt; 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.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              hanhsu hanhsu
              Reporter:
              cor3000 cor3000
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: