10

This one really puzzles me, as the code looks completely harmless.

IE8 halts script execution with a message:

Not implemented. map.js line:66 char:5

Here is a snip from the code:

63 if(data.map[x] !== undefined && data.map[x][y] !== undefined) {
64              
65   left = (x - data.dim.x_min)*32 + 30;
66   top = (data.dim.y_max - y)*32 + 30;
67
68  /* do stuff */
XX }

debug info: x:263 data.dim.x_min:263 y:172 data.dim.y_max:174

Data is object returned from JQuery Ajax call. This works in Firefox 3.0 and 3.5, safari 4.0.2 and I've only found this error when viewing the page in IE8. Forcing IE8 into IE7 mode does not make the error go away.

I don't have IE7 to debug with, but I got a tester saying that it doesn't work in IE7 either.

1
  • It looks right... I'm also interested to know why this doesn't work. Can you debug step by step? Commented Aug 14, 2009 at 19:14

2 Answers 2

20

The variable 'top' used in the code is an object of type DispHTMLWindow2 (outermost window object) and already in use by the browsers and that is causing the conflict, as that object cant be the target of the assignment operation. It seems that Firefox and Safari ignore this, while IE does not allow scripts to overwrite this.

Solutions for this:

1) Declare top you are using as local variable to define it's scope where it is used.

2) Rename the variable to something that doesn't conflict with this predefined global.

Description of other variable names you shouldn't use

Sign up to request clarification or add additional context in comments.

Comments

2

IE 8 has a great javascript debugger. You might want to add a breakpoint somewhere before the error and step through the code to see if something is strange with the data. IE8 is picky with trailing commas in lists which might be why you only get the error in it. You can pull the debugger up with F12, click Script and choose start debugging. You can add a break point by clicking on the margin where the line numbers are.

1 Comment

The F12 comment was handy to me. I was wondering how to get something in IE that functioned like Firebug, if only the basics.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.