javascript去除首尾空白字符
if ( twocode.replace(/^\s+|\s+$/g,"")=="" ) { alert("二维码不能为空"); document.getElementById("twocode").focus(); return false; }
if ( twocode.replace(/^\s+|\s+$/g,"")=="" ) { alert("二维码不能为空"); document.getElementById("twocode").focus(); return false; }