String.prototype.trimRight String.prototype.trimRight=function() { return this.replace(/\s*$/g,""); } 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 String.prototype.trim=function() { return this.replace(/^\s|\s$/g,""); } 谁讲解一下这个函数是什么意思?/^\s|\s$/g 照上面写String.prototype.trimRight=function() { return this.replace/^\s|\s$/g,""); } 属性值赋值及函数定义有错了!String.prototype.trimRight=function() { return this.replace(/\s*$/g,""); } 或者:function functioname() //函数名可以随便定{ return this.replace(/\s*$/g,""); } String.prototype.trimRight=functioname(); 高份求正则高手解决一下,即等 求一个最新正则表达式的帮助! 找人解释一下这段js代码,谢谢? jQuery不能获得弹出层中表单的value firefox 拖动的问题 如何获得一个元素的所有属性???? 求一个正则表达式在线等。 js ie6下如何优化 救急!!! 利用JS调用数据库中的值(新闻系统),高分相送!!! 怎样让标题栏闪动3下?settimeout的效果清除疑问 这段代码为何运行不了?调用时说缺少对象
{
return this.replace(/^\s|\s$/g,"");
}
{
return this.replace/^\s|\s$/g,"");
}
{
return this.replace(/\s*$/g,"");
}
或者:function functioname() //函数名可以随便定
{
return this.replace(/\s*$/g,"");
}
String.prototype.trimRight=functioname();