Javascript error in IE8: Not implemented

后端 未结 2 941
情话喂你
情话喂你 2021-02-20 12:55

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

IE8 halts script execution with a message:

Not implemented. map.js line:66 cha

2条回答
  •  佛祖请我去吃肉
    2021-02-20 13:49

    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

提交回复
热议问题