I get this whenever i try to alter an object in IE. The weird thing is that any function that only gets information works (such as alerting nodeValue) but whenever i try to alter the object (such as appendchild) to the object i get IE saying "Unexpected call to method or property" whilst it works fine in mozzilla.
The following works fine in FF but not in IE:
if (type = "editbox") control[c].appendChild(document.createElement('input'));
Is the line that bugs, if you change it into
if (type = "editbox") alert(control[c].getAttributeNode('fieldname').nodeValue);
IE picks the object up just fine all off a sudden.
What am i doing wrong ?
The following works fine in FF but not in IE:
Code:
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Test</title>
</head>
<body>
<div type="prog_title">Test</div>
<div type="window_title">Relaties</div>
<div type="header" sql="SELECT * FROM tblRelaties">
<control type="editbox" fieldname="RelatieID" disabled="true"> ID: </control>
<control type="editbox" fieldname="Naam"></control>
<control type="editbox" fieldname="Achternaam" validation="manditory"></control>
<control type="editbox" fieldname="WerknemersNo" validation="numeric"></control>
<control type="editbox" fieldname="Bedrijf"></control>
</div>
<a href="javascript:handle()">CLICK</a>
</body>
<script type="text/javascript">
function handle() {
var divs = document.getElementsByTagName("DIV");
var output = document.getElementsByTagName("OUTPUT");
for (i = 0; i < divs.length; i++) {
var type = divs[i].getAttributeNode('type').nodeValue
if (type == "header") {
var control = divs[i].getElementsByTagName("CONTROL")
for (c = 0; c < control.length; c++) {
type = control[c].getAttributeNode('type').nodeValue
if (type = "editbox") control[c].appendChild(document.createElement('input'));
}
}
}
}
</script>
</html>
Is the line that bugs, if you change it into
if (type = "editbox") alert(control[c].getAttributeNode('fieldname').nodeValue);
IE picks the object up just fine all off a sudden.
What am i doing wrong ?