{"id":1017,"date":"2023-03-23T13:13:09","date_gmt":"2023-03-23T13:13:09","guid":{"rendered":"https:\/\/blogs.glowscotland.org.uk\/es\/software\/?page_id=1017"},"modified":"2023-03-23T16:04:02","modified_gmt":"2023-03-23T16:04:02","slug":"javascript","status":"publish","type":"page","link":"https:\/\/blogs.glowscotland.org.uk\/es\/software\/authoring-a-website\/week-3\/javascript\/","title":{"rendered":"Javascript"},"content":{"rendered":"\n<p>Javascript is a form of client-side scripting, meaning scripting that runs on the client rather than the server. The client is the computer system (including tablets and mobile devices) which is running the web browser.<\/p>\n\n\n\n<p>Client-side scripting can be used to make web pages change after they arrive at the browser.<\/p>\n\n\n\n<p>Client side scripts can also be used to perform validation of data entered into forms.<\/p>\n\n\n\n<p>Client-side scripts are:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>interpreted by the browser<\/li><li>executed on the client system<\/li><\/ul>\n\n\n\n<p>JavaScript is the main client-side scripting language that can be used to create, delete, and manipulate HTML elements. You can type the Javascript code between script tags.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;script&gt;\n  Code goes here\n&lt;\/script&gt;<\/code><\/pre>\n\n\n\n<p>Extensive JavaScript code is often contained within its own file and linked to a webpage. This way the same code can be called from multiple webpages. <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;script src=\"script.js\"&gt;&lt;\/script&gt;<\/code><\/pre>\n\n\n\n<p>Some common tasks that can be performed using JavaScript relate to how the webpage responds to action taken by the user using their mouse or touchscreen.<\/p>\n\n\n\n<p>These are called mouse events.<\/p>\n\n\n\n<p>Using JavaScript, functions are created that will change what appears on screen depending upon what the user does with the mouse.<\/p>\n\n\n\n<p>There are a number of mouse events that are used in HTML code to trigger the execution of JavaScript functions.<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>onmouseout<\/li><li>onmouseover<\/li><li>onmousedown<\/li><li>onmouseup<\/li><li>onclick<\/li><li>onmousemove<\/li><\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">onmouseout<\/h2>\n\n\n\n<p>The onmouseout event occurs when the cursor is moved away from an element such as a button or a heading.<\/p>\n\n\n\n<div class=\"wp-block-columns is-layout-flex wp-container-core-columns-is-layout-9d6595d7 wp-block-columns-is-layout-flex\">\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\">\n<pre class=\"wp-block-code\"><code>&lt;!DOCTYPE html&gt;\n&lt;html lang=\"en\"&gt;\n&lt;head&gt;\n  &lt;title&gt;Javascript test&lt;\/title&gt;\n  &lt;style&gt;\n  #demo {\n    height: 10em;\n    width: 10em;\n    border: 1px solid black;\n  }\n  &lt;\/style&gt;\n  &lt;script type=\"text\/javascript\"&gt;\n  function mouseOut() {\n    document.getElementById(\"demo\").style.backgroundColor = \"red\";\n  }\n  &lt;\/script&gt;\n&lt;\/head&gt;\n&lt;body&gt;\n  &lt;header&gt;&lt;h1&gt;Javascript test&lt;h1&gt;&lt;\/header&gt;\n  &lt;main&gt;\n    &lt;div id=\"demo\" onmouseout=\"mouseOut()\"&gt; &lt;\/div&gt;\n  &lt;\/main&gt;\n&lt;\/body&gt;\n&lt;\/html&gt;<\/code><\/pre>\n<\/div>\n\n\n\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\">\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"271\" height=\"311\" src=\"https:\/\/blogs.glowscotland.org.uk\/es\/public\/software\/uploads\/sites\/4063\/2023\/03\/23132214\/js1.png\" alt=\"Example before mouse out\" class=\"wp-image-1021\" srcset=\"https:\/\/blogs.glowscotland.org.uk\/es\/public\/software\/uploads\/sites\/4063\/2023\/03\/23132214\/js1.png 271w, https:\/\/blogs.glowscotland.org.uk\/es\/public\/software\/uploads\/sites\/4063\/2023\/03\/23132214\/js1-261x300.png 261w\" sizes=\"auto, (max-width: 271px) 100vw, 271px\" \/><figcaption>Example before mouse out<\/figcaption><\/figure><\/div>\n\n\n\n<p>Move your mouse into the square and then out of it.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"274\" height=\"309\" src=\"https:\/\/blogs.glowscotland.org.uk\/es\/public\/software\/uploads\/sites\/4063\/2023\/03\/23132246\/js2.png\" alt=\"Example after mouse out\" class=\"wp-image-1022\" srcset=\"https:\/\/blogs.glowscotland.org.uk\/es\/public\/software\/uploads\/sites\/4063\/2023\/03\/23132246\/js2.png 274w, https:\/\/blogs.glowscotland.org.uk\/es\/public\/software\/uploads\/sites\/4063\/2023\/03\/23132246\/js2-266x300.png 266w\" sizes=\"auto, (max-width: 274px) 100vw, 274px\" \/><figcaption> Example after mouse out <\/figcaption><\/figure><\/div>\n\n\n\n<p>The background colour of the square should change to red.<\/p>\n<\/div>\n<\/div>\n\n\n\n<p>Here there is an event listener attached to the demo div. <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>onmouseout=\"mouseOut()\" <\/code><\/pre>\n\n\n\n<p><strong>onmouseout <\/strong>is the name of the listener, it triggers an event On the action of the Mouse going Out of the element. The value in the quotes is what happens on this event. In this code it calls the function called <strong>mouseOut<\/strong>, just like in Python you can tell it is a function call by the brackets. The brackets are empty so we aren&#8217;t passing any values into it.<\/p>\n\n\n\n<p>In the Javascript mouseOut function we only have one line:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>document.getElementById(\"demo\").style.backgroundColor = \"red\";<\/code><\/pre>\n\n\n\n<p>This is setting a new value to an entry in the Document Object Model (DOM) of the page. When a web page is loaded, the browser creates a&nbsp;Document&nbsp;Object&nbsp;Model of the page. This tree like structure contains all the elements of the page nested within each other, these elements might have attributes like href, height, id, class and so on, and values like the text contained in a link or paragraph.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"486\" height=\"266\" src=\"https:\/\/blogs.glowscotland.org.uk\/es\/public\/software\/uploads\/sites\/4063\/2023\/03\/23133115\/HTML34.png\" alt=\"Example DOM structure\" class=\"wp-image-1024\" srcset=\"https:\/\/blogs.glowscotland.org.uk\/es\/public\/software\/uploads\/sites\/4063\/2023\/03\/23133115\/HTML34.png 486w, https:\/\/blogs.glowscotland.org.uk\/es\/public\/software\/uploads\/sites\/4063\/2023\/03\/23133115\/HTML34-300x164.png 300w\" sizes=\"auto, (max-width: 486px) 100vw, 486px\" \/><figcaption>Example DOM structure<\/figcaption><\/figure><\/div>\n\n\n\n<p>Using the getElementById Javascript function you can access the matching element in the DOM structure.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>document.getElementById(\"demo\")<\/code><\/pre>\n\n\n\n<p>This accesses the object that contains all the HTML details for the element that matches the id provided. In this case demo.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>document.getElementById(\"demo\").style.backgroundColor<\/code><\/pre>\n\n\n\n<p>Using these objects, you can access attributes assigned to them such as style. Then within that view and alter the backgroundColor property of it. Notice the naming is different from CSS; backgroundColor versus background-color.<\/p>\n\n\n\n<p>If the object is an image, you can alter the image used with the src property. For example, to change the source image to test-image-large.png you could use:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>document.getElementById(\"image1\").src = \"images\/test-image-large.png\"<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">onmouseover&nbsp;<\/h2>\n\n\n\n<p>The onmouseover event occurs when the cursor is hovered over an element such as a button or a heading. Add the following Javascript to either your HTML file or separate script file.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>function mouseOver() {\n  document.getElementById(\"demo\").style.backgroundColor = \"blue\";\n}<\/code><\/pre>\n\n\n\n<p>Then update your demo div to include this new event:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;div id=\"demo\" onmouseout=\"mouseOut()\" onmouseover=\"mouseOver()\"&gt; &lt;\/div&gt;<\/code><\/pre>\n\n\n\n<p>Reload your page. Now when you mouse goes over the square the background colour should be set to blue, it will still turn red when you move out of the square.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">onmousedown&nbsp;<\/h2>\n\n\n\n<p>The onmousedown event occurs when the user presses a mouse button over an element.  Add the following Javascript to either your HTML file or separate script file. <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>function mouseDown() {\n  document.getElementsByTagName(\"main\")&#091;0].style.backgroundColor = \"#123456\";\n}<\/code><\/pre>\n\n\n\n<p> Then update your demo div to include this new event: <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;div id=\"demo\" onmouseout=\"mouseOut()\" onmouseover=\"mouseOver()\" onmousedown=\"mouseDown()\"&gt; &lt;\/div&gt;<\/code><\/pre>\n\n\n\n<div class=\"wp-block-columns is-layout-flex wp-container-core-columns-is-layout-9d6595d7 wp-block-columns-is-layout-flex\">\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\">\n<p>Save your code and reload your page and then click inside the square. The background colour of the main element should change to a dark blue.<\/p>\n<\/div>\n\n\n\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\">\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"627\" height=\"280\" src=\"https:\/\/blogs.glowscotland.org.uk\/es\/public\/software\/uploads\/sites\/4063\/2023\/03\/23154135\/js3.png\" alt=\"Example after triggering the onmousedown event\" class=\"wp-image-1028\" srcset=\"https:\/\/blogs.glowscotland.org.uk\/es\/public\/software\/uploads\/sites\/4063\/2023\/03\/23154135\/js3.png 627w, https:\/\/blogs.glowscotland.org.uk\/es\/public\/software\/uploads\/sites\/4063\/2023\/03\/23154135\/js3-300x134.png 300w\" sizes=\"auto, (max-width: 627px) 100vw, 627px\" \/><figcaption>Example after triggering the onmousedown event<\/figcaption><\/figure><\/div>\n<\/div>\n<\/div>\n\n\n\n<p>The getElementsByTagName function allows you to find all the DOM elements that match the tag name provided. This returns an array even if there is only a single match such as in this example where we look for the main tag.<\/p>\n\n\n\n<p>Because we are only interested in the first element of the array we access it with the 0<sup>th<\/sup>&nbsp;index just as we did in Python.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>document.getElementsByTagName(\"main\")&#091;0]<\/code><\/pre>\n\n\n\n<p>Arrays in Javascript behave just the same as they did in the Python course.<\/p>\n\n\n\n<p>The elements begin at 0.<\/p>\n\n\n\n<p>There is a built in length attribute to an array you can use to get an integer showing how many elements are in an array.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>number_of_elements = my_array.length;<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">onmouseup<\/h2>\n\n\n\n<p>The onmouseup event occurs when the user releases the mouse button over an element. Add the following Javascript to either your HTML file or separate script file. <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>function mouseUp() {\r\n  document.getElementsByTagName(\"main\")&#091;0].style.backgroundColor = \"#bc7887\";\r\n}<\/code><\/pre>\n\n\n\n<p> Then update your demo div to include this new event:  <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;div id=\"demo\" onmouseout=\"mouseOut()\" onmouseover=\"mouseOver()\" onmousedown=\"mouseDown()\" onmouseup=\"mouseUp()\"&gt; &lt;\/div&gt;<\/code><\/pre>\n\n\n\n<div class=\"wp-block-columns is-layout-flex wp-container-core-columns-is-layout-9d6595d7 wp-block-columns-is-layout-flex\">\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\">\n<p>Save the files and reload the page and then click inside the square. The background colour of the main element should change to a dark blue when you click the mouse button down, but then change to a dark pink when you release it. <\/p>\n<\/div>\n\n\n\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\">\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"627\" height=\"284\" src=\"https:\/\/blogs.glowscotland.org.uk\/es\/public\/software\/uploads\/sites\/4063\/2023\/03\/23154643\/js4.png\" alt=\"Example of onmouseup event\" class=\"wp-image-1030\" srcset=\"https:\/\/blogs.glowscotland.org.uk\/es\/public\/software\/uploads\/sites\/4063\/2023\/03\/23154643\/js4.png 627w, https:\/\/blogs.glowscotland.org.uk\/es\/public\/software\/uploads\/sites\/4063\/2023\/03\/23154643\/js4-300x136.png 300w\" sizes=\"auto, (max-width: 627px) 100vw, 627px\" \/><figcaption>Example of onmouseup event<\/figcaption><\/figure><\/div>\n<\/div>\n<\/div>\n\n\n\n<h2 class=\"wp-block-heading\">onclick<\/h2>\n\n\n\n<p>The onclick event occurs when the user clicks on an element such as a button or hyperlink. It is one event triggered after the mouse has been clicked down and then released. Add the following Javascript to either your HTML file or separate script file.  <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>function mouseClick() {\r\n  var menu_matches = document.getElementsByClassName(\"menu1\");\r\n  var counter;\r\n  for (counter = 0; counter&lt; menu_matches.length; counter++) {\r\n    menu_matches&#091;counter].style.backgroundColor = \"red\";\r\n  }\r\n}<\/code><\/pre>\n\n\n\n<p>Then update your demo div to include this new event and a list underneath:   <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;div id=\"demo\" onmouseout=\"mouseOut()\" onmouseover=\"mouseOver()\" onmousedown=\"mouseDown()\"\n               onmouseup=\"mouseUp()\" onclick=\"mouseClick()\"&gt; &lt;\/div&gt;\n&lt;ul&gt;\r\n  &lt;li class=\"list1\"&gt;1&lt;\/li&gt;\r\n  &lt;li&gt;2&lt;\/li&gt;\r\n  &lt;li class=\"list1\"&gt;3&lt;\/li&gt;\r\n  &lt;li&gt;4&lt;\/li&gt;\r\n&lt;\/ul&gt;<\/code><\/pre>\n\n\n\n<div class=\"wp-block-columns is-layout-flex wp-container-core-columns-is-layout-9d6595d7 wp-block-columns-is-layout-flex\">\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\">\n<p> Save the files and reload the page and then click inside the square.  The list elements that had the list1 class now have a background colour.<\/p>\n<\/div>\n\n\n\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\">\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"627\" height=\"398\" src=\"https:\/\/blogs.glowscotland.org.uk\/es\/public\/software\/uploads\/sites\/4063\/2023\/03\/23155438\/js5.png\" alt=\"Example after onclick event\" class=\"wp-image-1033\" srcset=\"https:\/\/blogs.glowscotland.org.uk\/es\/public\/software\/uploads\/sites\/4063\/2023\/03\/23155438\/js5.png 627w, https:\/\/blogs.glowscotland.org.uk\/es\/public\/software\/uploads\/sites\/4063\/2023\/03\/23155438\/js5-300x190.png 300w\" sizes=\"auto, (max-width: 627px) 100vw, 627px\" \/><figcaption>Example after onclick event<\/figcaption><\/figure><\/div>\n<\/div>\n<\/div>\n\n\n\n<p>In Javascript you can assign a variable using the var keyword.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>var counter;<\/code><\/pre>\n\n\n\n<p>The value can be set when the variable is assigned or at a later time.<\/p>\n\n\n\n<p>A&nbsp;<strong>for<\/strong>&nbsp;loop in Javascript has 3 parameters in the brackets that control how many times the code will go through the loop.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>for (counter = 0; counter&lt; menu_matches.length; counter++) {\n  \u2026\n}<\/code><\/pre>\n\n\n\n<p>The first part sets an initial value to a variable.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>counter = 0<\/code><\/pre>\n\n\n\n<p>The second part compares the variable against another variable or value each time around the loop to see if the loop should continue. This needs to return a Boolean true or false.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>counter &lt; menu_matches.length<\/code><\/pre>\n\n\n\n<p>The third part changes the value of the variable at the end of the current pass through the loop.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>counter++<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">onmousemove<\/h2>\n\n\n\n<p>The onmousemove event occurs when the cursor is moving over an element such as an image or menu.<\/p>\n\n\n\n<p>onmousemove happens whenever the mouse moves over the element whereas onmouseover only happens when the mouse enters the element or any child elements. Add the following to you Javascript:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>var height_size = 50;\r\nfunction mouseMove() {\r\n  height_size += 1;\r\n  document.getElementById(\"demo\").style.height = height_size + \"px\";\r\n}<\/code><\/pre>\n\n\n\n<p>And change your demo div code to be:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;div id=\"demo\" onmouseout=\"mouseOut()\" onmouseover=\"mouseOver()\" onmousedown=\"mouseDown()\"\n               onmouseup=\"mouseUp()\" onclick=\"mouseClick()\" onmousemove=\"mouseMove()\"&gt; &lt;\/div&gt;<\/code><\/pre>\n\n\n\n<p>Save your code and reload the page. Check what happens when you move the mouse around in the square. The square should start changing height as you move the mouse within it.<\/p>\n\n\n\n<p>Like in Python you can concatenate two or more strings together with a + sign.<\/p>\n\n\n\n<p>Unlike Python, Javascript is less strict and will automatically convert the integer into a string when it is concatenated with a string.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Printing<\/h2>\n\n\n\n<p>Browsers have a set of built-in functions that include the ability to print the screen. You can call that with the window.print() line.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;a href=\"#\" onclick=\"window.print()\"&gt;Print&lt;\/a&gt;<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Final thoughts<\/h2>\n\n\n\n<p>Javascript is powerful. You can do a lot with Javascript.<\/p>\n\n\n\n<p>You can validate forms to make sure that all fields have been filled out but no field has had too much data dumped into it which might identify a robot.<\/p>\n\n\n\n<p>You can collapse and expand various elements on the page based on where the user is looking.<\/p>\n\n\n\n<p>You can make feature rich interactive galleries that improve the experience for the user far beyond what is capable with just HTML and CSS.<\/p>\n\n\n\n<p>But&#8230;<\/p>\n\n\n\n<p>Javascript and any other client-side scripting is inherently unreliable.<\/p>\n\n\n\n<p>You don\u2019t know if a user, their browser, their anti-virus software, their company policies or anything else have disabled or limited client-side features. Because of this you cannot rely on client-side scripting to work.<\/p>\n\n\n\n<p><strong>Javascript should be used to improve the experience but the experience should not rely on it.<\/strong><\/p>\n\n\n\n<p class=\"nextlink\"><a href=\"https:\/\/blogs.glowscotland.org.uk\/es\/software\/authoring-a-website\/week-3\/designing-a-website\/\" data-type=\"page\" data-id=\"1039\">Next: Designing a website<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Javascript is a form of client-side scripting, meaning scripting that runs on the client rather than the server. The client is the computer system (including tablets and mobile devices) which is running the web browser. Client-side scripting can be used to make web pages change after they arrive at the browser. Client side scripts can&hellip; <a class=\"more-link\" href=\"https:\/\/blogs.glowscotland.org.uk\/es\/software\/authoring-a-website\/week-3\/javascript\/\">Continue reading <span class=\"screen-reader-text\">Javascript<\/span><\/a><\/p>\n","protected":false},"author":5710,"featured_media":0,"parent":58,"menu_order":1,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-1017","page","type-page","status-publish","hentry","entry"],"_links":{"self":[{"href":"https:\/\/blogs.glowscotland.org.uk\/es\/software\/wp-json\/wp\/v2\/pages\/1017","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blogs.glowscotland.org.uk\/es\/software\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/blogs.glowscotland.org.uk\/es\/software\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.glowscotland.org.uk\/es\/software\/wp-json\/wp\/v2\/users\/5710"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.glowscotland.org.uk\/es\/software\/wp-json\/wp\/v2\/comments?post=1017"}],"version-history":[{"count":14,"href":"https:\/\/blogs.glowscotland.org.uk\/es\/software\/wp-json\/wp\/v2\/pages\/1017\/revisions"}],"predecessor-version":[{"id":1041,"href":"https:\/\/blogs.glowscotland.org.uk\/es\/software\/wp-json\/wp\/v2\/pages\/1017\/revisions\/1041"}],"up":[{"embeddable":true,"href":"https:\/\/blogs.glowscotland.org.uk\/es\/software\/wp-json\/wp\/v2\/pages\/58"}],"wp:attachment":[{"href":"https:\/\/blogs.glowscotland.org.uk\/es\/software\/wp-json\/wp\/v2\/media?parent=1017"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}