Node cannot be inserted at the specified point in the hierarchy


今天搞代码firefox下发现一个报错:

Timestamp: 2012-12-24 18:04:15
Error: HierarchyRequestError: Node cannot be inserted at the specified point in the hierarchy
Source File: http://localhost:9002/public/js/jquery-1.8.0.min.js
Line: 2

搜索了一下, 没什么收获
仔细看了一下自己的代码, 原来是一个逻辑错误, 即用jQuery将自己或是父级添加到自己中去, 则firefox下会报此错误, ie没反应,  如下代码:


<div id="abc"><div id="def"> check it out </div></div>

<script>
$('#abc').html($('#abc'));//报错
$('#def').html($('#abc'));//报错
</script>

你可能感兴趣的:(JavaScript,jquery)