在调用trim()的JS方法上面加入如下JS代码:
String.prototype.trim = function(){
return this.replace(/(^/s*)|(/s*$)/g, "");
}
就可以像JAVA中使用trim()方法了:
if(document.forms[0].bb.value.trim()==""){
你的判断语句
}
在调用trim()的JS方法上面加入如下JS代码:
String.prototype.trim = function(){
return this.replace(/(^/s*)|(/s*$)/g, "");
}
就可以像JAVA中使用trim()方法了:
if(document.forms[0].bb.value.trim()==""){
你的判断语句
}