This article analyzes the compatibility issues of Javascript string browser. Share it for your reference. The specific analysis is as follows:
First, look at the incompatible writing method. If I want to get the number of a string
The code copy is as follows: var str='aavvvcc';
console.info(str[0]);
This writing method is incompatible with browsers below IE 7. The following provides full browser compatibility
The code copy is as follows: var str='aavvvcc';
console.info(str.charAt(1));
Use charAt() to get a character in the string and all are compatible.
I hope this article will be helpful to everyone's JavaScript programming.