我試圖用.indexOf找出如果數組包含字符串。有些東西正在造成錯誤,但我不知道是什麼。我敢肯定,這是一個真正簡單的事情,但我不知道的語言,因此看不到它。怎麼了?爲什麼我的indexOf語句創建一個錯誤
//this code creates an error in IE
var myMines=new Array();
var newMine="22";
var myVar = myMines.indexOf(newMine); //when I comment out this line, the page does not generate an error
舊的IE版本不支持'indexOf'爲陣列。 – kirilloid 2012-04-04 17:45:14
也,你得到什麼錯誤? – 2012-04-04 17:46:31
適用於Chrome和Firefox。 – Tuan 2012-04-04 17:47:24