PLEASE READ: Possible bug/conflict: API v3/jQuery .live() [w/test case]

244 views
Skip to first unread message

Ben P

unread,
Oct 15, 2010, 8:34:48 AM10/15/10
to Google Maps JavaScript API v3
http://gmapsbugtest.netii.net/

I'd appreciate any help I can get on this, as it's currently holding
me up on a project.

Here's the run-down on the example above:

1) It uses API v3 and jQuery 1.4.2
2) It uses jQuery to bind a 'change' event with .live (element doesn't
matter)
3) A polyline is drawn on the maps, with a 'click' event.addListener
4) When you click the polyline, IE8 will throw the following JS error:

Webpage error details

Message: Failed
Line: 63
Char: 165
Code: 0
URI: http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js


Let me know if you have ANY questions. I've tried to break it down as
simply as I could. To trigger the error, all you need is any .live()
binding to the 'change' event, to any element (whether it exists or
not), and a polyline using event.addListener to bind to a 'click'
event (it doesn't matter whether it actually does anything or not).

Any help is MUCH appreciated!

Ben P

unread,
Oct 15, 2010, 8:40:27 AM10/15/10
to Google Maps JavaScript API v3
I also get this error from the API v3 library:

Message: Failed
Line: 8
Char: 247
Code: 0
URI: http://maps.gstatic.com/intl/en_us/mapfiles/api-3/2/9/main.js

Ben P

unread,
Oct 19, 2010, 3:43:20 PM10/19/10
to Google Maps JavaScript API v3

Rossko

unread,
Oct 19, 2010, 6:49:07 PM10/19/10
to Google Maps JavaScript API v3
> Any ideas at all?

Seen these?
http://www.google.com/search?q=jquery+live+ie8

The comment about live() messing up regardless of what it is attached
to would be expected, as a consequence of it actually attaching to the
top level document (so that ALL events bubble up to it).

Ben P

unread,
Oct 21, 2010, 10:01:34 AM10/21/10
to Google Maps JavaScript API v3
Binding an element to 'change' in my example causes this bug. Binding
it to 'click' instead does not. I don't believe it's a broad problem
with live(), and even if it were, I wouldn't expect it to throw an
error (especially not 'Failed').

On Oct 19, 6:49 pm, Rossko <ros...@culzean.clara.co.uk> wrote:
> > Any ideas at all?
>
> Seen these?http://www.google.com/search?q=jquery+live+ie8

Andrew Leach

unread,
Oct 21, 2010, 10:12:49 AM10/21/10
to google-map...@googlegroups.com
On 21 October 2010 15:01, Ben P <bpo...@gmail.com> wrote:
> Binding an element to 'change' in my example causes this bug. Binding
> it to 'click' instead does not. I don't believe it's a broad problem
> with live(), and even if it were, I wouldn't expect it to throw an
> error (especially not 'Failed').

But that's just a product of IE's c**p (oops, sorry, "poor") error
handling and it's "poor" DOM handling. Your example behaves the same
way in IE6.

"Failed" is the message generated by attempting to manipulate the DOM
invalidly (like before it's completely defined). It wouldn't surprise
me if the way IE handles a "change" is to remove the element from the
DOM and replace it with the new version; and the way the resultant
event is handled doesn't fit into that strategy. Or something. That
means that while what IE does may be unorthodox, the current behaviour
hasn't changed since IE6 and so should not be unexpected; and it means
that jQuery should code for it and not cause a "Failed" error. So I
reckon it *is* an issue with .live() and that's where it should be
reported.

Matt Huggins

unread,
Oct 26, 2010, 12:34:40 PM10/26/10
to Google Maps JavaScript API v3
I'm experiencing the same issue with Maps API V3 and jQuery 1.4.3.
I'm not using live() events with the map at all; I simply set up
click() event listeners on parts of the map after the map content
should have already been loaded. Any solutions? I don't want my
users to see this error message since it seems to be working otherwise
(if I'm not mistaken). Thanks.

Chad Killingsworth

unread,
Oct 26, 2010, 1:48:54 PM10/26/10
to Google Maps JavaScript API v3
Do you have a link to your map?

Chad Killingsworth

Dizzy B High

unread,
Nov 12, 2010, 4:12:59 AM11/12/10
to google-map...@googlegroups.com
.live has issues with it, and sometimes causes things to not function, its to do with where on the dom it gets attached,

try using .delegate instead, might solve your problems http://api.jquery.com/delegate/
Reply all
Reply to author
Forward
0 new messages