Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IE9 javascript undefined errors

I tried fixing my application to work on IE9 browser (with IE9 standards mode).

However I am getting some undefined javascript errors..

I have the following piece of code in a js file.

1.

if(escape(String.fromCharCode(111)).toLowerCase() != "abc")

{

    //code

}

I get error 'escape' is undefined.

2. In some js files, I get errors "Array is undefined" for such piece of code

//1
function abc(){

this.abc = new Array();

}


//2

var cde = new Array
(

  "aaa","bb","cc",

  "dd","eee","ff",  

);

However these errors do not occur for IE8 standards mode and other modes.

Please let me know why these errors are coming and how to fix such errors.

like image 990
Girish Avatar asked Feb 12 '26 19:02

Girish


1 Answers

While Ryan's answer fixes the issue, the problem here is the trailing comma;

"dd","eee","ff",

like image 137
Neil Bryson Avatar answered Feb 14 '26 09:02

Neil Bryson



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!