In addition to using the $.extend
Extension tool function, you can extend the original object, and when Object
the object is extended, two objects are merged, and when the same property name exists, the latter overrides the former, and the calling format is:
$. extend (obj1,obj2,…objN);
The parameters obj1 through OBJN represent the various original objects that need to be merged.
<body> <div id= "Divtest" > <div class= "title" > <span class= "FL" > Merging existing objects </spa n> </div> <div class= "Content" > <div class= "Tip" ></div> </d iv> </div> <script type= "Text/javascript" > $(function () { varObjinfo = {Name: "" }; varobjmess = {name: "Bai Fu Mei,", title: "Welcome to contact me!" " }; varObjnewinfo =$.extend (objinfo,objmess); varstrtmp = "<b> object white rich beauty after </b>:<br/><br/>"; Strtmp+ = Objnewinfo.name +Objinfo.title; //Show in Page$ (". Tip"). Show (). append (strtmp); }); </script></body>
object after the merger of White rich beauty :
Mating, welcome to contact me!
JQuery Tool class function-Extend Object object with $.extend ()