Someone thankfully told me that they were having trouble viewing route maps in Microsoft Internet Explorer (IE). It turned out that creating routes in the admin screen was also broken in IE. It’s all fixed now; new version of Routes plugin will be released shortly. Sigh. For the developers among the audience, here is a list of some… shall we say “differences between JavaScript in IE and other browsers”? … that I had to find work-arounds for:

  • As documented on the Google Maps API site, in order to get Polylines (the route map lines) to work in IE, you have to add to the HTML namespace at the top of the file, and also you have to add a special style section. The style section I had already added, but the HTML namespace I hadn’t. Getting the namespace added to the admin screens meant modifying core WordPress code (something I’m not afraid to do). I did file a bug report so that the change could be added to a later WordPress release (with any luck, 2.2 due out later this month).
  • IE doesn’t execute Google Maps’ JavaScript scripts correctly if they are inside of <div> elements. So I had to move the JavaScript that makes the maps to the end of the file, requiring plugin users to make an additional theme modification.
  • Global variables are not recognized inside functions in IE sometimes; I am still not sure why or when, but I ended up having to create functions rather than trying to use global variables.
  • IE got confused when there was a JavaScript variable and an HTML DIV element with the same name, so I had to rename some JavaScript variables.
  • I had a syntax error where I initialized a variable to Array() (should have been new Array() ). FireFox did not flag it as a syntax error, and did what I meant, but in IE it didn’t work correctly.

Categories: News
States:
Last Modified: April 4, 2007

1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading ... Loading ...