jQuery.extend not working in Internet Explorer, but works in Firefox

Posted by Jared Stark on Stack Overflow See other posts from Stack Overflow or by Jared Stark
Published on 2010-04-02T23:36:32Z Indexed on 2010/04/02 23:43 UTC
Read the original article Hit count: 655

Filed under:
|
|

I am attempting the following:

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);

I should now expect to be able to do the following:

var c = new Class1();
c.AnotherMethod();

In Firefox 3.6 this works just fine. In Internet Explorer 7 & 8 it says "Object doesn't support this property or method".

Am I misunderstanding how $.extend should work, or is IE behaving badly?

jQuery Version: 1.3.2

Thanks!

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about extend