In IE7, why does Javascript fail to use index strings? The problem code is described as follows:
Function filter_str (str ){
Var res = "";
For (var I = 0; I
Var c = str. charCodeAt (I );
If (c> 32 & c! = 127 & c! = 39 ){
Res + = str [I]. toString (); // when IE7 or IE7 is the kernel, an error is reported.
}
}
Return res;
}
Do you know what the rule is?
Reply to discussion (solution)
IE (JScript) complies with earlier JavaScript conventions
Therefore, strings cannot be operated in array mode.
Str [I]. toString ()
Ying writing
Str. charAt (I)
IE (JScript) complies with earlier JavaScript conventions
Therefore, strings cannot be operated in array mode.
Str [I]. toString ()
Ying writing
Str. charAt (I)
Learning...
What is the difference between the early JavaScript conventions and the current JavaScript conventions? Where can I find out? are there any relevant documents?
Thank you.
I'm not sure about this (or I am not clear) to see this may help http://baike.baidu.com/link? Url = vKSyRkaROAwAyfcFmmbmx-RyfZ2fG4_jv07bOrmkCu5QRPI26ypDTj8COS8Xpx3D63sKpBaaJkpbPyOZ2Qr_gK
We recommend that you use the JQuery framework in view of the differences in js support of different browsers. In this way, it is not necessary to worry about compatibility.