Bug Tracker

Modify

Ticket #9046 (closed bug: invalid)

Opened 2 years ago

Last modified 8 months ago

$(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:
Blocking: Blocked by:

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.

Change History

comment:1 Changed 2 years ago by timmywil

  • Owner set to arsen
  • Priority changed from undecided to low
  • Status changed from new to pending
  • Component changed from unfiled to core

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.

comment:2 Changed 2 years ago by anonymous

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.

comment:3 Changed 2 years ago by timmywil

  • Status changed from pending to closed
  • Resolution set to invalid

Thanks for looking into it.

comment:4 follow-up: ↓ 5 Changed 2 years ago by 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

comment:5 in reply to: ↑ 4 Changed 8 months ago by anonymous

Replying to 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

comment:6 Changed 8 months ago by dmethvin

There's no test case indicating that jQuery was at fault here.

Please follow the  bug reporting guidlines and use  jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

View

Add a comment

Modify Ticket

Action
as closed
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.