24 extend jquery

Solutions on MaxInterview for 24 extend jquery by the best coders in the world

showing results for - " 24 extend jquery"
Elisa
12 Feb 2016
1<!doctype html>
2<html lang="en">
3<head>
4  <meta charset="utf-8">
5  <title>jQuery.extend demo</title>
6  <script src="https://code.jquery.com/jquery-3.5.0.js"></script>
7</head>
8<body>
9 
10<div id="log"></div>
11 
12<script>
13var object1 = {
14  apple: 0,
15  banana: { weight: 52, price: 100 },
16  cherry: 97
17};
18var object2 = {
19  banana: { price: 200 },
20  durian: 100
21};
22 
23// Merge object2 into object1
24$.extend( object1, object2 );
25 
26// Assuming JSON.stringify - not available in IE<8
27$( "#log" ).append( JSON.stringify( object1 ) );
28</script>
29 
30</body>
31</html>
32
Andrea
20 Sep 2019
1// merge all source objects into target object
2$.extend(targetObj, srcObj1, srcObj2/*, ...srcObjN */ );