function checkForm(){ var obj = document.getElementById('wordinput'), wordinput = obj.value; if(wordinput){ if(yanzheng(wordinput)){ window.location.href="/gangkou/"+wordinput+"__gks"; }else{ alert('格式错误!'); obj.focus(); } }else{ alert('请输入要查询的内容!'); obj.focus(); } return false; } function yanzheng(e) { return true; // return !!e.match(/[/\u0000-/\u00ff]/) }