我正在阅读此源代码,似乎有错误。任何人都可以说发生了什么
var JX = {
extend: function(bc, sc, o) {
var f = function() {};
f.prototype = sc.prototype;
bc.prototype = new f();
bc.prototype.constructor = bc;
bc.superclass = sc.prototype;
for (var m in o)
bc.prototype[m] = o[m];
}
};
JX.Component = function() {
JX.Component.superclass.init.apply(this, arguments);
};
JX.extend(JX.Component, jQuery, {});
$(document).ready(function() {
var mydiv = new JX.Component(document.createElement('div'));
mydiv.text("Hello World").click(function(){alert("You Clicked Me!")});
mydiv.appendTo(document.body);
alert("heee");
});
在appendTo之后出现错误