Ashok Eerla
Ashok Eerla

Reputation: 1

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.

Upvotes: 0

Views: 218

Answers (1)

Maurice Perry
Maurice Perry

Reputation: 32831

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.

Upvotes: 1

Related Questions