为什么javascript 提示缺少对象?

来源:百度知道 编辑:UC知道 时间:2024/05/08 17:01:45
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<script language="javascript">
function check(val)
{
window.all.location=checkUser.asp?user=val
}

</script>
</head>
<body>
<input name="user" type="text" id="user" size="15" maxlength="18" onBlur="javascript:check(this.value);">

提示缺少对象?

你不就是想做个跳转嘛 可以这样

<script type="text/javascript">
function check(val){
window.location="http://zhidao.baidu.com/question/"+ val +".html";
}
</script>
<input value="22629143" onBlur="javascript:check(this.value);">

你那个问题出在 window.all.location属性是不存在的

window.all.location="checkUser.asp?user="&val

location.href="checkUser.asp?user=val"