Hey guys,
Am I missing something here? My trim() function seems to halt JavaScript execution in Chrome. Why is this?
function trim(s) {
s = s.replace(/(^\\s*)|(\\s*$)/gi,"");
s = s.replace(/[ ]{2,}/gi," ");
s = s.replace(/\
/,"\
");
return s;
}
It works in IE and firefox… wait no it doesn’t. not anymore. wtf.