Web Development with jQuery®

(Elliott) #1

(^160) ❘ CHAPTER 5 ITERATION OF ARRAYS AND OBJECTS
The preceding script outputs the messages to the console, as shown in Figure 5-10.


FIGURE 5-10


Merging Two Arrays


jQuery’s $.merge() method can glue two arrays together to make a single array. The following
example, Example 5-11, demonstrates how this works:

<!DOCTYPE HTML>
<html lang='en'>
<head>
<meta http-equiv='X-UA-Compatible' content='IE=Edge' />
<meta charset='utf-8' />
<title>$.merge()</title>
<script src='../jQuery.js'></script>
<script src='../jQueryUI.js'></script>
<script src='Example 5-11.js'></script>
</head>
<body>

</body>
</html>

http://www.it-ebooks.info

Free download pdf