简体   繁体   中英

IE 10 not event not firing bind() or on() using JQuery

$('body').unload(function () {

});
$('body').on("beforeunload", function () {

  //if true Means Logged is Clicked else Page close clicked
  if (IsTrue == 0) {
    BTGUI.WebServices.ConnectionToken.GetLogOutClientUserMethod(LogOutClientUserMethodSucess);
  }
  else {
    BTGUI.WebServices.ConnectionToken.PageClosedXmlMethod(hddClient, hddUserName);
  }

Bind() or on() events are not firing in IE 10,Except IE working all browsers fine. any IE version this will work I'm using jquery 1.7.0 I'm also tested $(window) not working.

Yes, the event handler should be bound to $(window). A beforeunload handler is supposed to only return a string to be displayed in a confirmation box. It seems to me that you're doing a lot more than that.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM