{"id":1595,"date":"2017-03-30T12:51:00","date_gmt":"2017-03-30T12:51:00","guid":{"rendered":"https:\/\/blogs.glowscotland.org.uk\/nl\/ColtnessHS-ComputingScience\/?p=1595"},"modified":"2017-03-30T12:53:56","modified_gmt":"2017-03-30T12:53:56","slug":"n5-coding","status":"publish","type":"post","link":"https:\/\/blogs.glowscotland.org.uk\/nl\/ColtnessHS-ComputingScience\/2017\/03\/30\/n5-coding\/","title":{"rendered":"N5 &#8211; Coding"},"content":{"rendered":"<blockquote><p>Description and identification of coding to create and modify information systems including JavaScript mouse events.<\/p><\/blockquote>\n<p>\n<a href=\"https:\/\/www.w3schools.com\/js\/default.asp\">Javascript <\/a>is used in HTML documents to add interactivity. The HTML file below has a number of interactive elements to it. Use notepad++ to investigate it further.<\/p>\n<pre class=\"brush: xml; collapse: true; light: false; title: javascript.html; toolbar: true; notranslate\" title=\"javascript.html\">\r\n&lt;!DOCTYPE html&gt;\r\n&lt;html&gt;\r\n&lt;head&gt;\r\n&lt;title&gt; Teacher Example  &lt;\/title&gt;\r\n&lt;!--     \r\nThe &lt;script&gt; in the &lt;head&gt; tag allows the functions to be called from \r\nanywhere in the document\r\n--&gt;\r\n&lt;script&gt;\r\n\r\n&lt;!-- Changes Style on Mouse Over --&gt;\r\nfunction mouseOver() {\r\ndocument.getElementById(&quot;demo&quot;).style.color = &quot;red&quot;;\r\n}\r\n\r\n&lt;!-- Changes Style back after Mouse Over --&gt;\r\nfunction mouseOut() {\r\ndocument.getElementById(&quot;demo&quot;).style.color = &quot;black&quot;;\r\n}\r\n&lt;!-- Asks for and displays a name --&gt;\r\nfunction myFunction() {\r\n&lt;!-- Asks the user to enter their name --&gt;\r\n    var person = prompt(&quot;Please enter your name&quot;, &quot;Harry Potter&quot;);\r\n\t&lt;!-- Displays the persons name in ID demo3 --&gt;\r\n    if (person != null) {\r\n        document.getElementById(&quot;demo3&quot;).innerHTML =\r\n        &quot;Hello &quot; + person + &quot;! How are you today?&quot;;\r\n    }\r\n}\r\n&lt;\/script&gt;\r\n\r\n&lt;\/head&gt;\r\n\r\n&lt;body&gt;\r\n&lt;!-- Display a heading that can be changed later --&gt;\r\n&lt;h1 id=&quot;demo&quot; onmouseover=&quot;mouseOver()&quot; onmouseout=&quot;mouseOut()&quot;&gt;Welcome&lt;\/h1&gt;\r\n\r\n&lt;!-- Displays a button that when pressed will display the date in the first Heading--&gt;\r\n&lt;p&gt;\r\n&lt;button type=&quot;button&quot;\r\nonclick=&quot;document.getElementById('demo').innerHTML = Date()&quot;&gt;\r\nClick me to display Date and Time.&lt;\/button&gt;\r\n\r\n&lt;!-- Uses Javascript to display the message &quot;Your Text Here&quot; --&gt;\r\n&lt;p&gt;\r\n&lt;script&gt;\r\ndocument.write(&quot;Your Text Here&quot;);\r\n&lt;\/script&gt;\r\n\r\n&lt;!-- The text RESULT is not displayed as it is replaced by \r\n     the results of the calculation below it--&gt;\r\n&lt;h1 id=&quot;demo2&quot;&gt;RESULT&lt;\/h1&gt;\r\n&lt;script&gt;\r\nvar price1 = 5;\r\nvar price2 = 6;\r\nvar total = price1 + price2;\r\ndocument.getElementById(&quot;demo2&quot;).innerHTML =\r\n&quot;The total is: &quot; + total;\r\n&lt;\/script&gt;\r\n\r\n&lt;!-- This button calls the function myFunction from above --&gt;\r\n&lt;p&gt;Click the button to demonstrate the prompt box.&lt;\/p&gt;\r\n&lt;button onclick=&quot;myFunction()&quot;&gt;Try it&lt;\/button&gt;\r\n&lt;p id=&quot;demo3&quot;&gt;&lt;\/p&gt;\r\n\r\n&lt;\/body&gt;\r\n&lt;\/html&gt;\r\n<\/pre>\n<blockquote><p>Description, exemplification and implementation of coding to create and modify information system including the use of HTML with the tags for:<br \/>\n      o Document<br \/>\n      o Links<br \/>\n      o Graphics\n<\/p><\/blockquote>\n<p>\nThe documents below show a HTML document with the basic html document tags and a document showing the html tags for links <a><\/a> and images <img><\/p>\n<pre class=\"brush: xml; collapse: true; light: false; title: bare.html; toolbar: true; notranslate\" title=\"bare.html\">\r\n&lt;!DOCTYPE html&gt;\r\n&lt;html&gt;\r\n&lt;head&gt;\r\n&lt;title&gt; &lt;\/title&gt;\r\n&lt;\/head&gt;\r\n&lt;body&gt;\r\n\r\n&lt;\/body&gt;\r\n&lt;\/html&gt;\r\n<\/pre>\n<pre class=\"brush: xml; collapse: true; light: false; title: page1.html; toolbar: true; notranslate\" title=\"page1.html\">\r\n&lt;!DOCTYPE html&gt;\r\n&lt;html&gt;\r\n&lt;head&gt;\r\n&lt;title&gt; Page1 &lt;\/title&gt;\r\n&lt;\/head&gt;\r\n&lt;body&gt;\r\n&lt;h1&gt;Example of a heading of type 1&lt;\/h1&gt;\r\n\r\n&lt;h2&gt;And this is heading 2&lt;\/h2&gt;\r\n\r\n&lt;!-- The anchor tag &lt;a&gt; is used to link a html document to another document. \r\n     The href attribute gives the name of the destination of the link. --&gt;\r\n&lt;p&gt;Here is a paragraph of text,\r\nwhich includes a link to &lt;a href=&quot;page2.html&quot;&gt;page 2&lt;\/a&gt;&lt;\/p&gt;\r\n\r\n&lt;p&gt;\r\n&lt;!-- The image tag &lt;img&gt; is used to display an image.\r\n     The src attribute is the name of the image --&gt;\r\n&lt;image src=&quot;logo.png&quot;&gt;\r\n\r\n&lt;\/body&gt;\r\n&lt;\/html&gt;\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Description and identification of coding to create and modify information systems including JavaScript mouse events. Javascript is used in HTML documents to add interactivity. The HTML file below has a number of interactive elements to it. Use notepad++ to investigate it further. &lt;!DOCTYPE html&gt; &lt;html&gt; &lt;head&gt; &lt;title&gt; Teacher Example &lt;\/title&gt; &lt;!&#8211; The &lt;script&gt; in the &hellip;<\/p>\n","protected":false},"author":32,"featured_media":1385,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[17939,17010,17013],"tags":[9201,432052],"class_list":["post-1595","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-coding","category-information-systems-development","category-national-5","tag-html","tag-javascript"],"jetpack_featured_media_url":"https:\/\/blogs.glowscotland.org.uk\/nl\/public\/ColtnessHS-ComputingScience\/uploads\/sites\/12638\/2016\/09\/Slide3.png","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/blogs.glowscotland.org.uk\/nl\/ColtnessHS-ComputingScience\/wp-json\/wp\/v2\/posts\/1595","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blogs.glowscotland.org.uk\/nl\/ColtnessHS-ComputingScience\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.glowscotland.org.uk\/nl\/ColtnessHS-ComputingScience\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.glowscotland.org.uk\/nl\/ColtnessHS-ComputingScience\/wp-json\/wp\/v2\/users\/32"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.glowscotland.org.uk\/nl\/ColtnessHS-ComputingScience\/wp-json\/wp\/v2\/comments?post=1595"}],"version-history":[{"count":12,"href":"https:\/\/blogs.glowscotland.org.uk\/nl\/ColtnessHS-ComputingScience\/wp-json\/wp\/v2\/posts\/1595\/revisions"}],"predecessor-version":[{"id":1607,"href":"https:\/\/blogs.glowscotland.org.uk\/nl\/ColtnessHS-ComputingScience\/wp-json\/wp\/v2\/posts\/1595\/revisions\/1607"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blogs.glowscotland.org.uk\/nl\/ColtnessHS-ComputingScience\/wp-json\/wp\/v2\/media\/1385"}],"wp:attachment":[{"href":"https:\/\/blogs.glowscotland.org.uk\/nl\/ColtnessHS-ComputingScience\/wp-json\/wp\/v2\/media?parent=1595"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.glowscotland.org.uk\/nl\/ColtnessHS-ComputingScience\/wp-json\/wp\/v2\/categories?post=1595"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.glowscotland.org.uk\/nl\/ColtnessHS-ComputingScience\/wp-json\/wp\/v2\/tags?post=1595"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}