firstly please review a code sample below .
<html> <head> <script src="http://code.jquery.com/jquery-1.9.1.js"></script> <script type="text/javascript"> /**/ $(function(){ var baseObj=function(){ this.firstname="joe"; this.lastname="wang"; }; var childObj=function(){ this.firstname="wq"; }; var b= new baseObj(); var c = new childObj(); baseObj.call(c); alert(c.firstname); }); </script> </head> <body> </body> </html>
the output is "joe" instead of the "wq".
so, found the mystery the call ?
see also:
http://stackoverflow.com/questions/4166616/understanding-the-difference-between-object-create-and-new-somefunction-in-j