【发布时间】:2010-01-18 09:57:27
【问题描述】:
我在页面中有以下 html:
<head>
<script src="jquery-1.3.2.min.js" type="text/javascript"></script>
<script>
function hideIt() {
$(this).hide("slow");
return true;
}
</script>
</head>
<body>
<div onclick="hideIt();">
hello world
</div>
</body>
当我点击 div 时,会导致以下 JavaScript 错误:
行:53 错误:'this[...].style' 为 null 或不是对象
有什么解决办法吗?
【问题讨论】:
-
在 javascript 中出现此类错误很常见,解决这些问题的一个好方法是使用内置调试器,或
console.log()有问题的项目。
标签: javascript jquery jquery-ui