IE7, JavaScript uses the [] index string, failed, why?
This post was last edited by CSDNCB on 2015-05-11 09:14:07
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 (); Errors are reported in IE7 or IE7 for kernel browsing
}
}
return res;
}
Know what the rules are, cause?
------to solve the idea----------------------
IE (JScript) adheres to early JavaScript conventions
So the string cannot be manipulated as an array.
Str[i].tostring ()
Should write
Str.charat (i)
------to solve the idea----------------------
Reference:
IE (JScript) adheres to early JavaScript conventions
So the string cannot be manipulated as an array.
Str[i].tostring ()
Should write
Str.charat (i)
Learn the ...
------to solve the idea----------------------
I didn't say it (and I don't know). Look at this, it might help, http://baike.baidu.com/link?url=vKSyRkaROAwAyfcFmmbmx-RyfZ2fG4_. Jv07bormkcu5qrpi26ypdtj8cos8xpx3d63skpbaajkpbpyoz2qr_gk
In view of the differences in JavaScript support for each browser, it is recommended to use the JQuery framework. So you don't have to worry about compatibility.