[code="javascript"]function EditInPlaceField(id, parent, value) {
this.id = id;
this.parent = parent;
this.value = value || "default value";
this.createElements();
};
EditInPlaceField.prototype = {
createElements : function() {
this.container = document.createElement("div");
this.parent.appendChild(this.container);
},
};
var my = new EditInPlaceField("my", parent, "hello world");
var parent = document.getElementById("div");[/code]
错误信息:[color=red]Uncaught TypeError: Object [object Window] has no method 'appendChild' [/color]
弄了大半天,试了很多种方法都不行。请问这是什么原因啊?