Skip to main content

Bug Tracker

Side navigation

#6716 closed bug (invalid)

Opened June 24, 2010 09:40AM UTC

Closed June 25, 2010 01:41AM UTC

Last modified March 15, 2012 01:10PM UTC

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)
Change History (2)

Changed June 24, 2010 11:49AM UTC by dfsramos comment:1

Replying to [ticket:6716 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

Changed June 25, 2010 01:41AM UTC by dmethvin comment:2

resolution: → invalid
status: newclosed

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