I had some problems with IE8 involving a search for substrings containing white spaces and their substitution by nothing ('') inside an element captured by outerHTML: that approach simply did not work; the IE8 Javascript engine returned the expected result + two white spaces in the beginning (I had to substitute all white spaces of the returned string by bullets, to visualize that) + inappropriate jQuery object information in the middle.
I modified my code, substituting in the original string all white space by bullets (•). Then I did a search for substrings containing bullets and substitute them by nothing (''), and the code worked well.
As an example, follows a code to get the ID value of an element:
// DOES NOT WORK WITH IE8
var titleDiv = title.get(0).outerHTML; // should return <div id="patrimonio">Patrimônio</div>
var idA = titleDiv.replace(/.+\sid=('|")?/, ''); // patrimonio">Patrimônio</div>
idA = idA.replace(/(\s|'|").+/g, ''); // patrimonio
// WORKS WITH IE8
var titleDiv = title.get(0).outerHTML.replace(/\s/g, '•'); //IE8 returns ••<div•id="patrimonio"•jQuery17209680172580078536="34">Patrimônio</div> , Others browsers return <div•id="patrimonio">Patrimônio</div>
var idA = titleDiv.replace(/.+•id=('|")?/, '');
idA = idA.replace(/(•|'|").+/g, '');