<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
<script>
var val = typeof (abc);
if (val != "undefined");
{
alert("");
}
</script>
</head>
<body>
</body>
</html>
[/code]
以上代码,我用firefox中调试已经得到val 为了“undefined”了
但我判断val!="undefined" 的时候为什么还是为true而不是false呢谢谢
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
<script type="text/javascript">
var a=typeof (abc);
alert(a=="undefined")
</script> </head>
<body>
<input type="submit" value="提交" onclick="checkUpdate();"/>
</body>
</html>
显示true
{
alert("");
}
ok