Prototype Insertion, IE 6, tr’s, and “invalid target element for this operation…”After much hardship I’m giving up on trying to use Prototype’s Insertion function for inserting new rows after a specified target row. Everything I try works in Firefox but blows out in IE 6, which is the “supported platform”. After some searching it seems IE has inconsistent support for the insertAdjacentHTML method, and apparently for elements like TR and TBODY IE will throw an exception if the method is called on those methods. In the latest prerelease there is a fix for tbodys, but nothing for tr, and my knowledge of dom manipulation fell short when trying to hack that in. If anyone can see how to add that to prototype.js, please let me know. This seems like something that would be commonly done with Rails apps for dynamically adding rows to a table, so its curious that I couldn’t find anything via Google… google到了一篇文章
这个src一看就不顺眼
比如 test.html需要使用prototype.js,如果test.html和prototype.js在同一文件夹下,你可以这样用 :
<script language="javascript" src="prototype.js"></script>
如果不在同一文件夹下,都要相对于test.html的路径来写。
<script language="javascript" src="js/prototype.js"></script>
js文件夹和test.html同以目录
或者报告 未知错误
我的是IE6
<body>
<textarea id="area"></textarea>
<script>
document.getElementById("area").insertAdjacentHTML("beforeBegin","<div>ssssssssss</div>");
new Insertion.Top("area","<div>ssssssssss</div>");
</script>
</body>似乎是prototype.js的问题,因该以上两语句是等效的。但是后者却出错了。
google到了一篇文章