Hello.
I am trying the following example (from:
http://developer.mozilla.org/en/docs/DOM:range.insertNode):
<html>
<head>
<title>xxx</title>
</head>
<body>
<script type="text/javascript">
range = document.createRange();
newNode = document.createElement("p");
newNode.appendChild(document.createTextNode("New Node Inserted Here"));
range.selectNode(document.getElementsByTagName("div").item(0));
range.insertNode(newNode);
</script>
<div>test</div>
</body>
</html>
But i am getting this errorcode:
Error: uncaught exception: [Exception... "Parameter is not an object"
code: "1003" nsresult: "0x805303eb (NS_ERROR_DOM_NOT_OBJECT_ERR)"
location: "file:///location/test.html Line: 12"]
Which is this line:
range.selectNode(document.getElementsByTagName("div").item(0));
I dont get it.
Greets.
_______________________________________________
Project_owners mailing list
[email protected]
https://www.mozdev.org/mailman/listinfo/project_owners