Bug Tracker

Opened 13 years ago

Closed 13 years ago

Last modified 12 years ago

#6716 closed bug (invalid)

Jquery 1.3.2 -> 1.4.2 unload event problem

Reported by: dfsramos Owned by:
Priority: Milestone: 1.4.3
Component: unfiled Version: 1.4.2
Keywords: jquery unload 1.4.2 Cc:
Blocked by: Blocking:

Description

I'm currently developing a webapplication. I was using Jquery 1.3.2 and everything went smoothly. For plugin usage I had to change to version 1.4.2, but when doing so some of the pages on my webapplication somehow caught a problem. When I try to leave them they ALWAYS show the "Are you sure you want to navigate away from this page?" message.

Maybe this isn't quite a bug, but I would like to know which part of the jquery code is doing this so I could try and attempt a fix.

Thanks in advance.

Attachments (1)

leavepagealert.png (6.9 KB) - added by dfsramos 13 years ago.

Download all attachments as: .zip

Change History (3)

Changed 13 years ago by dfsramos

Attachment: leavepagealert.png added

comment:1 in reply to:  description Changed 13 years ago by dfsramos

Replying to dfsramos:

I'm currently developing a webapplication. I was using Jquery 1.3.2 and everything went smoothly. For plugin usage I had to change to version 1.4.2, but when doing so some of the pages on my webapplication somehow caught a problem. When I try to leave them they ALWAYS show the "Are you sure you want to navigate away from this page?" message.

Maybe this isn't quite a bug, but I would like to know which part of the jquery code is doing this so I could try and attempt a fix.

Thanks in advance.

I kind of solved the problem myself. But I think this shouldn't be quite a solution.

I was binding a function to the $(window).bind("beforeunload"....

And in it I was doing "return true;"

I think jquery was taking "true" as a response and using it to confirm me leaving the page (hence, chrome was alerting "true" instead of the firefox default "Are you sure you want to leave this page").

My solution was removing the "true" and simply do "return;"

But I think this bit of jquery needs a litle tweaking!

Cheers

comment:2 Changed 13 years ago by dmethvin

Resolution: invalid
Status: newclosed

As documented, the unload events are not supported by jQuery; attach them directly to the window object.

Note: See TracTickets for help on using tickets.