我試圖如下: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