和“ ”(空格)是不同的
十一月 9th, 2007 by xLight
下面这段代码在fireFox和IE中的结果是不同的
function trim (str)
{
return str.replace(/ */g, '');
}
function getTextContent (el)
{
if (el.textContent) return el.textContent;
if (el.innerText) return el.innerText;
if (el.innerHTML) return
el.innerHTML.replace(/( )|( )|( )/g, ' ');
}
here is the text 0.123
tag:javascript 正则



