我试图如下:jQuery.extend无法在Internet Explorer工作,但在Firefox
var Class1 = function() {}
Class1.prototype = {
MyMethod: function() { /* Do Stuff */ }
}
var Class2 = function() {}
Class2.prototype = {
AnotherMethod: function() { /* Do More Sweet Stuff */ }
}
jquery.extend(true, Class1, Class2);
我现在应该期望能够做到以下几点:
var c = new Class1();
c.AnotherMethod();
在Firefox 3.6这工作得很好。在Internet Explorer 7 & 8中显示“对象不支持此属性或方法”。
我误解了$ .extend应该如何工作,或者IE的行为不好?
jQuery的版本:1.3.2
谢谢!
难道这与你的套管在jquery.extend(...)'上有什么关系吗?它不应该是'jQuery.extend(...)'? – 2010-04-02 23:40:14