Side navigation
#9046 closed bug (invalid)
Opened May 02, 2011 03:07PM UTC
Closed May 06, 2011 03:35PM UTC
Last modified October 22, 2012 02:05PM UTC
$(document).ready happens too soon in IE and causes Bing Map undefined error when drawing a polygon
Reported by: | arsen | Owned by: | arsen |
---|---|---|---|
Priority: | low | Milestone: | 1.next |
Component: | core | Version: | 1.5.2 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
There seems to be an issue on pages that are based on ASP.NET Web Forms (with ScriptManager) platform and that include Bing Maps API v7.0
When the map is initialized in the $(document).ready jQuery function, it appears to happen a bit too early and results in intermittent "undefined" errors in veapicore.js.
To fix the problem, the map initialization code needs to be moved from $(document).ready to Sys.WebForms.PageRequestManager.getInstance().add_pageLoaded() event handler.
The pageLoaded() always happens AFTER the $(document).ready and the undefined error is resolved.
It is possible that there is something special about IE browser and Bing Map V7 that uses VML or other elements that load slower and that $(document).ready is not catching these.
Attachments (0)
Change History (6)
Changed May 02, 2011 10:25PM UTC by comment:1
component: | unfiled → core |
---|---|
owner: | → arsen |
priority: | undecided → low |
status: | new → pending |
Changed May 06, 2011 01:22AM UTC by comment:2
Hi,
Thank you for the $(window).load suggestion. When using $(window).load instead of $(document).ready the Bing Map works fine.
This issue can be closed.
Changed May 06, 2011 03:35PM UTC by comment:3
resolution: | → invalid |
---|---|
status: | pending → closed |
Thanks for looking into it.
Changed June 16, 2011 03:56PM UTC by comment:4
This bit me pretty hard and I wasted quite a bit of time on it, even to the point of digging, by hand, fruitlessly (of course), through the Bing Maps' minified javascript source code.
I disagree that this isn't a valid bug, but at least, for the sake of posterity, and helping the next person coming along from a google search, I'll put a few keywords here.
Bing Maps v7 IE Internet Explorer polygon undefined null VML error exception
Changed October 22, 2012 08:47AM UTC by comment:5
Replying to [comment:4 anonymous]:
This bit me pretty hard and I wasted quite a bit of time on it, even to the point of digging, by hand, fruitlessly (of course), through the Bing Maps' minified javascript source code. I disagree that this isn't a valid bug, but at least, for the sake of posterity, and helping the next person coming along from a google search, I'll put a few keywords here. Bing Maps v7 IE Internet Explorer polygon undefined null VML error exception
I agree completely! Just because there is a *workaround* doesn't mean that it isn't broken!!
Thanks for the tags that lead me here by the way!
--Mikey
Changed October 22, 2012 02:05PM UTC by comment:6
There's no test case indicating that jQuery was at fault here.
Thanks for taking the time to contribute to the jQuery project! Please provide a reduced test case that reproduces the issue experienced to help us assess your ticket.
My first thought is you may simply need to bind to $(window).load instead to wait for the VML to load, which is probably what add_pageLoaded is doing.