I have the following jQuery call that returns a match in FF / Chrome but returns null in IE 8.
Here is the fiddle if you want to try it for yourself.
And here is the unsolvable, unacceptable, wayward code:
var m = $('#somediv').text().match(/\d+-(\d+)\sof\s(\d+)/);
EDIT: Thanks to Rob W. I narrowed it down a bit; The following works, so it is specifically "out" or "\ sof \ s" that fails. Fork the violin and try a few for yourself :(
var m = $('#somediv').text().match(/\d+\D(\d+)\D+(\d+)/);
Rob W, , replace , , , . Rob W , , jQuery text(), .
replace
text()
- HTML, replace, , .
Unicode (00A0) IE 8 IE 7:
var m = t.replace(/\u00a0/g, ' ').match(/\d+-(\d+)\sof\s(\d+)/);
IE 9 , , , \s. IE , , ,
\s
. , .text(), replace .
.text()
var m = t.replace(/ /g, ' ').match(/\d+-(\d+)\sof\s(\d+)/);
, alert(t), , .
alert(t)
RegExp:
/\d+-(\d+)\xa0of+\xa0(\d+)/
http://jsfiddle.net/gilly3/KNbpN/
, IE8 (\s).
Source: https://habr.com/ru/post/1529180/More articles:Разница между созданием объекта с использованием `new ClassName` и` new ClassName() `в PHP - syntaxJS: How to add negative numbers in javascript - javascriptSeparate mobile views and layouts for mobile pages - ruby-on-railsSplit string value in array of arrays in Python - python.split () regex with sliding brackets doesn't work in IE8 - javascriptHow to place pop-up control in a Windows Store app in relation to a button? - c #NodeJS: Does fs.appendFile support a file link, so adding is faster? - node.jsEmberJS: secure callbacks when browsing is destroyed? - javascriptGrunt - create empty file - fileКак отключить навигационную панель в iOS - iosAll Articles