Javascript examples for jQuery Method and Property:extend
Jquery merge two objects
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script> <script type="text/javascript"> $(window).load(function(){/*from www .jav a 2 s . c om*/ anObj={'propone':'1', 'proptwo':'2'}; anotherObj={'propel':'11', 'proptlv':'12'}; var opts = {}; $.extend(opts, anObj, anotherObj, { bar: "baz", thing: "foo" }); console.log(opts); }); </script> </head> <body> </body> </html>