Firefox中出现错误 missing ( before formal parameters
function String.prototype.Trim()
{
return this.replace(/^\\s*/g,"").replace(/\s*\$/g,"");
}
错误行显示在这个函数上,是不是这种写法Firefox不支持?
[解决办法]
这样就好了。
String.prototype.Trim = function() { return this.replace(/^\s*|\s*$/g,"");}alert("[" + " 123 ".Trim() + "]")