asp.net String.prototype.split of compatibility issues

  • 2020-05-19 04:31:04
  • OfStack

IE String.prototype.split () function bug

Script:

"a:b:c".split(/(:)/)

Firefox output: ["a",":","b",":","c"]

IE7/8 (including IE9 compatible mode) output:

a,b,c

When \n appears in the text box of IE9, it will be removed as needed, while IE7/8 (including IE9 compatible mode) does not appear

Such as

12 12

12 12

1212 \n12 12 this is in IE9 and IE7/8 (including IE9 compatible mode) is 12 1212 12


Related articles: