×

Loading...

Chrome browser's handling of <button> is weird!

sailor (Ocean & Mountain)

In Chrome, if we do not put type=”button” in a <button> element, Chrome browser would trigger the window.onbeforeunload event handler for AJAX calls!

 

The workaround:

 

Always add the attribute of type=”button” in <button>.  Example:

 

<button class="doSomething" type="button">doSomething</button>

      

 

(#4010@4096)
8-31 -05:00
Reply
Page address has been copied.
To share, click to copy page address.
Share Online by QR Code

Back To Topic: Chrome browser's handling of <button> is weird!

Back To Forum: HOMEForum