{"id":136,"date":"2017-04-21T19:14:30","date_gmt":"2017-04-21T19:14:30","guid":{"rendered":"https:\/\/courses.lumenlearning.com\/suny-the-missing-link-an-introduction-to-web-development-and-programming\/chapter\/chapter-34-javascript-syntax\/"},"modified":"2019-06-17T14:29:52","modified_gmt":"2019-06-17T14:29:52","slug":"chapter-34-javascript-syntax","status":"publish","type":"chapter","link":"https:\/\/courses.lumenlearning.com\/suny-the-missing-link-an-introduction-to-web-development-and-programming\/chapter\/chapter-34-javascript-syntax\/","title":{"raw":"Chapter 34: JavaScript Syntax","rendered":"Chapter 34: JavaScript Syntax"},"content":{"raw":"<div class=\"bc-section section\">\r\n<h1 class=\"ChapterNumber\">Tags<\/h1>\r\n<\/div>\r\n<div class=\"bc-section section\">\r\n<p class=\"BodyFirst\">Defining your block of JavaScript code in HTML is done with the use of another set of HTML tags we have not used yet, &lt;script&gt;. The script tags allow us to link to a script file or mark off a section of our code for our JavaScript to reside in. We can place script tags in any section of our HTML. Traditionally, JavaScript is placed in the head of the page, especially when the code consists of functions to be called or actions that are to occur on page load. If your JavaScript will be shorter or creates some simple output, you might find it easier to place it in your code where you want the output to be.<\/p>\r\nAs the &lt;script&gt; tags can be used for more than just JavaScript, it is recommended to clarify what type of code the tags contain. To start with an example where we link to an external JavaScript file, we will use a &lt;script&gt; tag and give it attributes to define what our code is and where it lives.\r\n<div class=\"textbox examples\">\r\n<h3 class=\"red_h\">Additional Notes<\/h3>\r\n<p class=\"red_p\">If your JavaScript\u2019s action or output is not critical to visual layout or output of your page, you can move &lt;script&gt; tags to the bottom of your page. This allows the page to render before processing your JavaScript, and gives the user a faster (seeming) experience.<\/p>\r\n\r\n<\/div>\r\n<pre>&lt;script type=\"text\/javascript \" src=\"http:\/\/someplace.com\/scripts\/ourscript.js\"&gt;<\/pre>\r\nThis example would populate the &lt;script&gt; tag set with the contents of the JavaScript file just like we did with CSS. Also like our CSS examples, we can place our JavaScript entirely in the HTML as well. To use the ubiquitous Hello World example yet again, we would replace our example above with the following:\r\n<pre>&lt;script type=\"text\/javascript\"&gt;\r\n\r\n<span class=\"CodeIndent1\">alert(\"Hello World!\");<\/span>\r\n\r\n&lt;\/script&gt;<\/pre>\r\nThe alert function in JavaScript will create the pop up box in our browser that must be closed by the user. By placing this block of code into either the head or body of a blank page as follows, we will get an alert box instead of text on the page:\r\n<pre>&lt;html&gt;\r\n\r\n<span class=\"CodeIndent1\">&lt;head&gt;<\/span>\r\n\r\n<span class=\"CodeIndent2\">&lt;script type=\"text\/javascript\"&gt;<\/span>\r\n\r\n<span class=\"CodeIndent2\">alert(\"Hello World!\");<\/span>\r\n\r\n<span class=\"CodeIndent2\">&lt;\/script&gt;<\/span>\r\n\r\n<span class=\"CodeIndent1\">&lt;\/head&gt;<\/span>\r\n\r\n&lt;body\/&gt;\r\n\r\n&lt;\/html&gt;<\/pre>\r\nNot only is this a little more exciting than just printing it onto our page, we can even add some control to when we receive this output by giving it a trigger event. A trigger event is anything that can be monitored in order to cause another action to occur. In this case, our trigger event will be a click of a button. To do this, we need to stop our alert from running as soon as the page loads. We will do that by wrapping it in a function declaration so it only runs when we call it, and then add a button that calls the function:\r\n<pre>&lt;head&gt;\r\n\r\n<span class=\"CodeIndent1\">&lt;script&gt;<\/span>\r\n\r\n<span class=\"CodeIndent2\">function howdy(){<\/span>\r\n\r\n<span class=\"CodeIndent2\">alert(\"Hello world!\");<\/span>\r\n\r\n<span class=\"CodeIndent2\">}<\/span>\r\n\r\n<span class=\"CodeIndent1\">&lt;\/script&gt;<\/span>\r\n\r\n&lt;\/head&gt;\r\n\r\n&lt;body&gt;\r\n\r\n<span class=\"CodeIndent1\">&lt;input type=\"button\" onclick=\"howdy()\" value=\"Our Button\" \/&gt;<\/span>\r\n\r\n&lt;\/body&gt;<\/pre>\r\n<img class=\"aligncenter\" src=\"https:\/\/s3-us-west-2.amazonaws.com\/courses-images\/wp-content\/uploads\/sites\/1755\/2017\/04\/21191429\/chap34_tags_fmt.png\" alt=\"Button that says &quot;Our Button&quot; that triggers an pop-up tag saying, &quot;Hello world!&quot;\" width=\"436\" height=\"230\" \/>\r\n\r\nNow when we load our page, the alert window will not show up until we click our button. If it does not, you may need to check your JavaScript settings to make sure it is allowed in your browser. If you are unfamiliar with how to do this, search the Internet for your browser type, version number, and the words enable JavaScript for directions. JavaScript is usually enabled by default, so a double check of your code for typos may also be in order.\r\n<h1>Variables<\/h1>\r\nCreating variables in JavaScript is very similar to PHP. The variable names still need to begin with a letter, and are case sensitive. They can also start with $ or _ to help us identify them. One difference is that when we declare variables in JavaScript, we do so by putting \u201cvar\u201d in front of them. This identifies what follows as a variable, like the $ in PHP. To convert our example into a string variable, we would adjust it as follows:\r\n<pre>&lt;head&gt;\r\n\r\n<span class=\"CodeIndent1\">&lt;script&gt;<\/span>\r\n\r\n<span class=\"CodeIndent2\">function howdy(){<\/span>\r\n\r\n<span class=\"CodeIndent2\">var str=\"Hello World\";<\/span>\r\n\r\n<span class=\"CodeIndent2\">alert(str);<\/span>\r\n\r\n<span class=\"CodeIndent2\">}<\/span>\r\n\r\n<span class=\"CodeIndent1\">&lt;\/script&gt;<\/span>\r\n\r\n&lt;\/head&gt;\r\n\r\n&lt;body&gt;\r\n\r\n<span class=\"CodeIndent1\">&lt;input type=\"button\" onclick=\"howdy()\" value=\"Our Button\" \/&gt;<\/span>\r\n\r\n&lt;\/body&gt;<\/pre>\r\n<h1>Output<\/h1>\r\nThe \u201cecho\u201c or \u201cprint\u201d equivalent in JavaScript can be achieved by instructing it to place the text you want into the DOM (<a href=\"https:\/\/courses.lumenlearning.com\/suny-the-missing-link-an-introduction-to-web-development-and-programming\/chapter\/chapter-7-markup-languages\/#DOM\"><span class=\"Hyperlink\">Document Object Model<\/span><\/a>). We reference the document object in JavaScript with the word document, and call the write method to produce our output:\r\n<pre>&lt;script language=\"javascript\"&gt;\r\n\r\n<span class=\"CodeIndent1\">document.write (\"Some output from &lt;b&gt;JavaScript!&lt;\/b&gt;\");<\/span>\r\n\r\n&lt;\/script&gt;<\/pre>\r\nWe can be more specific as to the exact place(s) on the page we wish to put our content. In PHP, we would simply place our print or echo statement where we want the content to appear. With JavaScript we can continue to take advantage of the document object model to specify where we want output to be. This also means the script that makes the content can be stored in a separate location from the output location itself:\r\n<pre>&lt;script language=\"javascript\"&gt;\r\n\r\n<span class=\"CodeIndent1\">document.getElementById(\"ourText\").innerHTML =\"Hello World\";<\/span>\r\n\r\n&lt;\/script&gt;\r\n\r\n&lt;div id=\"ourText\"&gt;&lt;\/div&gt;<\/pre>\r\nNo matter where the \u201courText\u201d div is on our page, or where the script is, the div would contain Hello World as its text. This is the basic approach taken when we use JavaScript to make changes to our page.\r\n<h1>Strings<\/h1>\r\nWhile strings work largely the same as they do in PHP and other languages, concatenation is achieved by the use of the concat() function, or the plus (+) sign instead of PHP\u2019s use of period (.). Let us take a look at a couple examples to see the difference:\r\n<pre>str1 = \"Hello World!\";\r\n\r\nstr2 = \"How are you?\";\r\n\r\noutput = str1.concat(str2); \/\/ Note we use . to access concat() from the string\r\n\r\noutput = str1 + \" \" + str2; \/\/ Concating with +, which works like PHP's .<\/pre>\r\n<h1>Arrays<\/h1>\r\nArrays in JavaScript work in much the same way as PHP. All we need to keep in mind is that our output needs to use DOM manipulation:\r\n<pre>&lt;script&gt;\r\n\r\n\/\/Some examples of setting and using array variables\r\n\r\n<span class=\"CodeIndent1\">var x;<\/span>\r\n\r\n<span class=\"CodeIndent1\">var mycars = new Array();<\/span>\r\n\r\n<span class=\"CodeIndent1\">mycars[0] = \u201cSaab\u201d;<\/span>\r\n\r\n<span class=\"CodeIndent1\">mycars[1] = \u201cVolvo\u201d;<\/span>\r\n\r\n<span class=\"CodeIndent1\">mycars[2] = \u201cBMW\u201d;<\/span>\r\n\r\n<span class=\"CodeIndent1\">for (x=0; x&lt;stooges.length; x++){<\/span>\r\n\r\n<span class=\"CodeIndent2\">document.write(mycars[x] + \u201c&lt;br&gt;\u201d);<\/span>\r\n\r\n<span class=\"CodeIndent1\">}<\/span>\r\n\r\n&lt;\/script&gt;<\/pre>\r\n<h1>Braces and Semi-colons<\/h1>\r\nWhen a control structure only has one line, JavaScript will allow us to skip the curly brackets that would normally outline its contents. We also do not need to include semi-colons as long as we include a line break after most statements. However, leaving either of these items out can create bugs by inconsistent coding. Adding a second line to your condition statement when not using brackets might work in some cases, but not all. Instead of a syntax error, though, it would be interpreted as part of the next statement after it. This will create a harder to find logic error.\r\n<div class=\"textbox exercises\">\r\n<h3 class=\"learn-h\">Learn more<\/h3>\r\n<p class=\"learn-m\">Keywords, search terms: JavaScript syntax<\/p>\r\n<p class=\"learn-m\">Mozilla Developer Network: <a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/JavaScript?redirectlocale=en-US&amp;redirectslug=JavaScript\"><span class=\"Hyperlink\">https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/JavaScript?redirectlocale=en-US&amp;redirectslug=JavaScript<\/span><\/a><\/p>\r\n\r\n<\/div>\r\n<\/div>","rendered":"<div class=\"bc-section section\">\n<h1 class=\"ChapterNumber\">Tags<\/h1>\n<\/div>\n<div class=\"bc-section section\">\n<p class=\"BodyFirst\">Defining your block of JavaScript code in HTML is done with the use of another set of HTML tags we have not used yet, &lt;script&gt;. The script tags allow us to link to a script file or mark off a section of our code for our JavaScript to reside in. We can place script tags in any section of our HTML. Traditionally, JavaScript is placed in the head of the page, especially when the code consists of functions to be called or actions that are to occur on page load. If your JavaScript will be shorter or creates some simple output, you might find it easier to place it in your code where you want the output to be.<\/p>\n<p>As the &lt;script&gt; tags can be used for more than just JavaScript, it is recommended to clarify what type of code the tags contain. To start with an example where we link to an external JavaScript file, we will use a &lt;script&gt; tag and give it attributes to define what our code is and where it lives.<\/p>\n<div class=\"textbox examples\">\n<h3 class=\"red_h\">Additional Notes<\/h3>\n<p class=\"red_p\">If your JavaScript\u2019s action or output is not critical to visual layout or output of your page, you can move &lt;script&gt; tags to the bottom of your page. This allows the page to render before processing your JavaScript, and gives the user a faster (seeming) experience.<\/p>\n<\/div>\n<pre>&lt;script type=\"text\/javascript \" src=\"http:\/\/someplace.com\/scripts\/ourscript.js\"&gt;<\/pre>\n<p>This example would populate the &lt;script&gt; tag set with the contents of the JavaScript file just like we did with CSS. Also like our CSS examples, we can place our JavaScript entirely in the HTML as well. To use the ubiquitous Hello World example yet again, we would replace our example above with the following:<\/p>\n<pre>&lt;script type=\"text\/javascript\"&gt;\r\n\r\n<span class=\"CodeIndent1\">alert(\"Hello World!\");<\/span>\r\n\r\n&lt;\/script&gt;<\/pre>\n<p>The alert function in JavaScript will create the pop up box in our browser that must be closed by the user. By placing this block of code into either the head or body of a blank page as follows, we will get an alert box instead of text on the page:<\/p>\n<pre>&lt;html&gt;\r\n\r\n<span class=\"CodeIndent1\">&lt;head&gt;<\/span>\r\n\r\n<span class=\"CodeIndent2\">&lt;script type=\"text\/javascript\"&gt;<\/span>\r\n\r\n<span class=\"CodeIndent2\">alert(\"Hello World!\");<\/span>\r\n\r\n<span class=\"CodeIndent2\">&lt;\/script&gt;<\/span>\r\n\r\n<span class=\"CodeIndent1\">&lt;\/head&gt;<\/span>\r\n\r\n&lt;body\/&gt;\r\n\r\n&lt;\/html&gt;<\/pre>\n<p>Not only is this a little more exciting than just printing it onto our page, we can even add some control to when we receive this output by giving it a trigger event. A trigger event is anything that can be monitored in order to cause another action to occur. In this case, our trigger event will be a click of a button. To do this, we need to stop our alert from running as soon as the page loads. We will do that by wrapping it in a function declaration so it only runs when we call it, and then add a button that calls the function:<\/p>\n<pre>&lt;head&gt;\r\n\r\n<span class=\"CodeIndent1\">&lt;script&gt;<\/span>\r\n\r\n<span class=\"CodeIndent2\">function howdy(){<\/span>\r\n\r\n<span class=\"CodeIndent2\">alert(\"Hello world!\");<\/span>\r\n\r\n<span class=\"CodeIndent2\">}<\/span>\r\n\r\n<span class=\"CodeIndent1\">&lt;\/script&gt;<\/span>\r\n\r\n&lt;\/head&gt;\r\n\r\n&lt;body&gt;\r\n\r\n<span class=\"CodeIndent1\">&lt;input type=\"button\" onclick=\"howdy()\" value=\"Our Button\" \/&gt;<\/span>\r\n\r\n&lt;\/body&gt;<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter\" src=\"https:\/\/s3-us-west-2.amazonaws.com\/courses-images\/wp-content\/uploads\/sites\/1755\/2017\/04\/21191429\/chap34_tags_fmt.png\" alt=\"Button that says &quot;Our Button&quot; that triggers an pop-up tag saying, &quot;Hello world!&quot;\" width=\"436\" height=\"230\" \/><\/p>\n<p>Now when we load our page, the alert window will not show up until we click our button. If it does not, you may need to check your JavaScript settings to make sure it is allowed in your browser. If you are unfamiliar with how to do this, search the Internet for your browser type, version number, and the words enable JavaScript for directions. JavaScript is usually enabled by default, so a double check of your code for typos may also be in order.<\/p>\n<h1>Variables<\/h1>\n<p>Creating variables in JavaScript is very similar to PHP. The variable names still need to begin with a letter, and are case sensitive. They can also start with $ or _ to help us identify them. One difference is that when we declare variables in JavaScript, we do so by putting \u201cvar\u201d in front of them. This identifies what follows as a variable, like the $ in PHP. To convert our example into a string variable, we would adjust it as follows:<\/p>\n<pre>&lt;head&gt;\r\n\r\n<span class=\"CodeIndent1\">&lt;script&gt;<\/span>\r\n\r\n<span class=\"CodeIndent2\">function howdy(){<\/span>\r\n\r\n<span class=\"CodeIndent2\">var str=\"Hello World\";<\/span>\r\n\r\n<span class=\"CodeIndent2\">alert(str);<\/span>\r\n\r\n<span class=\"CodeIndent2\">}<\/span>\r\n\r\n<span class=\"CodeIndent1\">&lt;\/script&gt;<\/span>\r\n\r\n&lt;\/head&gt;\r\n\r\n&lt;body&gt;\r\n\r\n<span class=\"CodeIndent1\">&lt;input type=\"button\" onclick=\"howdy()\" value=\"Our Button\" \/&gt;<\/span>\r\n\r\n&lt;\/body&gt;<\/pre>\n<h1>Output<\/h1>\n<p>The \u201cecho\u201c or \u201cprint\u201d equivalent in JavaScript can be achieved by instructing it to place the text you want into the DOM (<a href=\"https:\/\/courses.lumenlearning.com\/suny-the-missing-link-an-introduction-to-web-development-and-programming\/chapter\/chapter-7-markup-languages\/#DOM\"><span class=\"Hyperlink\">Document Object Model<\/span><\/a>). We reference the document object in JavaScript with the word document, and call the write method to produce our output:<\/p>\n<pre>&lt;script language=\"javascript\"&gt;\r\n\r\n<span class=\"CodeIndent1\">document.write (\"Some output from &lt;b&gt;JavaScript!&lt;\/b&gt;\");<\/span>\r\n\r\n&lt;\/script&gt;<\/pre>\n<p>We can be more specific as to the exact place(s) on the page we wish to put our content. In PHP, we would simply place our print or echo statement where we want the content to appear. With JavaScript we can continue to take advantage of the document object model to specify where we want output to be. This also means the script that makes the content can be stored in a separate location from the output location itself:<\/p>\n<pre>&lt;script language=\"javascript\"&gt;\r\n\r\n<span class=\"CodeIndent1\">document.getElementById(\"ourText\").innerHTML =\"Hello World\";<\/span>\r\n\r\n&lt;\/script&gt;\r\n\r\n&lt;div id=\"ourText\"&gt;&lt;\/div&gt;<\/pre>\n<p>No matter where the \u201courText\u201d div is on our page, or where the script is, the div would contain Hello World as its text. This is the basic approach taken when we use JavaScript to make changes to our page.<\/p>\n<h1>Strings<\/h1>\n<p>While strings work largely the same as they do in PHP and other languages, concatenation is achieved by the use of the concat() function, or the plus (+) sign instead of PHP\u2019s use of period (.). Let us take a look at a couple examples to see the difference:<\/p>\n<pre>str1 = \"Hello World!\";\r\n\r\nstr2 = \"How are you?\";\r\n\r\noutput = str1.concat(str2); \/\/ Note we use . to access concat() from the string\r\n\r\noutput = str1 + \" \" + str2; \/\/ Concating with +, which works like PHP's .<\/pre>\n<h1>Arrays<\/h1>\n<p>Arrays in JavaScript work in much the same way as PHP. All we need to keep in mind is that our output needs to use DOM manipulation:<\/p>\n<pre>&lt;script&gt;\r\n\r\n\/\/Some examples of setting and using array variables\r\n\r\n<span class=\"CodeIndent1\">var x;<\/span>\r\n\r\n<span class=\"CodeIndent1\">var mycars = new Array();<\/span>\r\n\r\n<span class=\"CodeIndent1\">mycars[0] = \u201cSaab\u201d;<\/span>\r\n\r\n<span class=\"CodeIndent1\">mycars[1] = \u201cVolvo\u201d;<\/span>\r\n\r\n<span class=\"CodeIndent1\">mycars[2] = \u201cBMW\u201d;<\/span>\r\n\r\n<span class=\"CodeIndent1\">for (x=0; x&lt;stooges.length; x++){<\/span>\r\n\r\n<span class=\"CodeIndent2\">document.write(mycars[x] + \u201c&lt;br&gt;\u201d);<\/span>\r\n\r\n<span class=\"CodeIndent1\">}<\/span>\r\n\r\n&lt;\/script&gt;<\/pre>\n<h1>Braces and Semi-colons<\/h1>\n<p>When a control structure only has one line, JavaScript will allow us to skip the curly brackets that would normally outline its contents. We also do not need to include semi-colons as long as we include a line break after most statements. However, leaving either of these items out can create bugs by inconsistent coding. Adding a second line to your condition statement when not using brackets might work in some cases, but not all. Instead of a syntax error, though, it would be interpreted as part of the next statement after it. This will create a harder to find logic error.<\/p>\n<div class=\"textbox exercises\">\n<h3 class=\"learn-h\">Learn more<\/h3>\n<p class=\"learn-m\">Keywords, search terms: JavaScript syntax<\/p>\n<p class=\"learn-m\">Mozilla Developer Network: <a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/JavaScript?redirectlocale=en-US&amp;redirectslug=JavaScript\"><span class=\"Hyperlink\">https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/JavaScript?redirectlocale=en-US&amp;redirectslug=JavaScript<\/span><\/a><\/p>\n<\/div>\n<\/div>\n\n\t\t\t <section class=\"citations-section\" role=\"contentinfo\">\n\t\t\t <h3>Candela Citations<\/h3>\n\t\t\t\t\t <div>\n\t\t\t\t\t\t <div id=\"citation-list-136\">\n\t\t\t\t\t\t\t <div class=\"licensing\"><div class=\"license-attribution-dropdown-subheading\">CC licensed content, Shared previously<\/div><ul class=\"citation-list\"><li>The Missing Link. <strong>Authored by<\/strong>: Michael Mendez. <strong>Provided by<\/strong>: Open SUNY Textbooks. <strong>Located at<\/strong>: <a target=\"_blank\" href=\"https:\/\/textbooks.opensuny.org\/the-missing-link-an-introduction-to-web-development-and-programming\/\">https:\/\/textbooks.opensuny.org\/the-missing-link-an-introduction-to-web-development-and-programming\/<\/a>. <strong>License<\/strong>: <em><a target=\"_blank\" rel=\"license\" href=\"https:\/\/creativecommons.org\/licenses\/by-nc-sa\/4.0\/\">CC BY-NC-SA: Attribution-NonCommercial-ShareAlike<\/a><\/em><\/li><\/ul><\/div>\n\t\t\t\t\t\t <\/div>\n\t\t\t\t\t <\/div>\n\t\t\t <\/section>","protected":false},"author":311,"menu_order":13,"template":"","meta":{"_candela_citation":"[{\"type\":\"cc\",\"description\":\"The Missing Link\",\"author\":\"Michael Mendez\",\"organization\":\"Open SUNY Textbooks\",\"url\":\"https:\/\/textbooks.opensuny.org\/the-missing-link-an-introduction-to-web-development-and-programming\/\",\"project\":\"\",\"license\":\"cc-by-nc-sa\",\"license_terms\":\"\"}]","CANDELA_OUTCOMES_GUID":"","pb_show_title":"on","pb_short_title":"","pb_subtitle":"","pb_authors":[],"pb_section_license":""},"chapter-type":[],"contributor":[],"license":[],"class_list":["post-136","chapter","type-chapter","status-publish","hentry"],"part":121,"_links":{"self":[{"href":"https:\/\/courses.lumenlearning.com\/suny-the-missing-link-an-introduction-to-web-development-and-programming\/wp-json\/pressbooks\/v2\/chapters\/136","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/courses.lumenlearning.com\/suny-the-missing-link-an-introduction-to-web-development-and-programming\/wp-json\/pressbooks\/v2\/chapters"}],"about":[{"href":"https:\/\/courses.lumenlearning.com\/suny-the-missing-link-an-introduction-to-web-development-and-programming\/wp-json\/wp\/v2\/types\/chapter"}],"author":[{"embeddable":true,"href":"https:\/\/courses.lumenlearning.com\/suny-the-missing-link-an-introduction-to-web-development-and-programming\/wp-json\/wp\/v2\/users\/311"}],"version-history":[{"count":4,"href":"https:\/\/courses.lumenlearning.com\/suny-the-missing-link-an-introduction-to-web-development-and-programming\/wp-json\/pressbooks\/v2\/chapters\/136\/revisions"}],"predecessor-version":[{"id":346,"href":"https:\/\/courses.lumenlearning.com\/suny-the-missing-link-an-introduction-to-web-development-and-programming\/wp-json\/pressbooks\/v2\/chapters\/136\/revisions\/346"}],"part":[{"href":"https:\/\/courses.lumenlearning.com\/suny-the-missing-link-an-introduction-to-web-development-and-programming\/wp-json\/pressbooks\/v2\/parts\/121"}],"metadata":[{"href":"https:\/\/courses.lumenlearning.com\/suny-the-missing-link-an-introduction-to-web-development-and-programming\/wp-json\/pressbooks\/v2\/chapters\/136\/metadata\/"}],"wp:attachment":[{"href":"https:\/\/courses.lumenlearning.com\/suny-the-missing-link-an-introduction-to-web-development-and-programming\/wp-json\/wp\/v2\/media?parent=136"}],"wp:term":[{"taxonomy":"chapter-type","embeddable":true,"href":"https:\/\/courses.lumenlearning.com\/suny-the-missing-link-an-introduction-to-web-development-and-programming\/wp-json\/pressbooks\/v2\/chapter-type?post=136"},{"taxonomy":"contributor","embeddable":true,"href":"https:\/\/courses.lumenlearning.com\/suny-the-missing-link-an-introduction-to-web-development-and-programming\/wp-json\/wp\/v2\/contributor?post=136"},{"taxonomy":"license","embeddable":true,"href":"https:\/\/courses.lumenlearning.com\/suny-the-missing-link-an-introduction-to-web-development-and-programming\/wp-json\/wp\/v2\/license?post=136"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}