JQuery Tool class function-Extend Object object with $.extend ()

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.