{"id":10570,"date":"2014-11-13T05:09:06","date_gmt":"2014-11-12T18:09:06","guid":{"rendered":"http:\/\/www.rjmprogramming.com.au\/wordpress\/?p=10570"},"modified":"2014-11-13T05:09:06","modified_gmt":"2014-11-12T18:09:06","slug":"firefox-scratchpad-javascript-primer-tutorial","status":"publish","type":"post","link":"https:\/\/www.rjmprogramming.com.au\/ITblog\/firefox-scratchpad-javascript-primer-tutorial\/","title":{"rendered":"Firefox Scratchpad Javascript Primer Tutorial"},"content":{"rendered":"<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/wordpress\/tictactoe.html\"><img decoding=\"async\" style=\"border: 15px solid pink;\" alt=\"Firefox Scratchpad Javascript Primer Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/wordpress\/justjs.jpeg\" title=\"Firefox Scratchpad Javascript Primer Tutorial\" id='aazxcv'  onmouseover='   this.src=this.src.replace(\".jpg\",\".PNG\").replace(\".png\",\".BMP\").replace(\".gif\",\".JPEG\").replace(\".jpeg\",\".JPG\").replace(\".bmp\",\".GIF\").replace(\".JPG\",\".jpg\").replace(\".GIF\",\".gif\").replace(\".JPEG\",\".jpeg\").replace(\".PNG\",\".png\").replace(\".BMP\",\".bmp\");   ' style=\"float:left;\" \/><\/a><p class=\"wp-caption-text\">Firefox Scratchpad Javascript Primer Tutorial<\/p><\/div>\n<p>Today&#8217;s <a target=_blank title='click picture' href='http:\/\/www.rjmprogramming.com.au\/wordpress\/tictactoe.html'>tutorial<\/a> looks at the scenario of webpages &#8220;virtually&#8221; just made up of Javascript &#8230; &#8220;virtually&#8221; because we&#8217;ve stopped short of turning this into a bookmarklet.   Today we write the Tic Tac Toe game in Javascript &#8220;virtually&#8221; only.<\/p>\n<p>If you don&#8217;t have a bookmarklet, how do you test Javascript on its own?   Well, you&#8217;ve probably guessed by this blog posting&#8217;s title, that one alternative here is the Firefox browser&#8217;s Scratchpad functionality, available off its Tools menu.<\/p>\n<p>By Scratchpad we do not mean an iPad set aside for your dog to scratch itself on &#8230; but why aren&#8217;t you thinking of the pooch &#8230; where&#8217;s the inventor of &#8220;PoochPad&#8221; or &#8220;itPad&#8221;? &#8230; but rather a good tool to test the workings of your Javascript to validate it and check its workings.<\/p>\n<p>For today&#8217;s tutorial also make use of the Javascript function <a target=_blank title='Javascript function document.createElement() information from w3schools' href='http:\/\/www.w3schools.com\/jsref\/met_document_createelement.asp'>document.createElement()<\/a> as the way the Javascript gets to create the Tic Tac Toe board (the HTML you have <a target=_blank title='Claytons' href='https:\/\/www.youtube.com\/watch?v=ylH43Tcaj60'>when you aren&#8217;t<\/a> &#8220;really&#8221; &#8220;virtually&#8221; having HTML).<\/p>\n<p>You can download Javascript source code and rename to <a target=_blank href='http:\/\/www.rjmprogramming.com.au\/wordpress\/tictactoe.js_GETME' title=\"tictactoe.js\">tictactoe.js<\/a> supervised by the puny <a target=_blank href='http:\/\/www.rjmprogramming.com.au\/wordpress\/tictactoe.html_GETME' title=\"tictactoe.html\">tictactoe.html<\/a> as you see fit.<\/p>\n<p>Should you find Tac Tac Toe (or even Noughts and Crosses) addictive you should see <a target=_blank title='Wargames' href='http:\/\/www.youtube.com\/watch?v=NHWjlCaIrQo'>this<\/a> &#8230; amazing, really amazing!<\/p>\n<p>If this was interesting you may be interested in <a title='Click here to see topics in which you might be interested' href='#d10570' onclick='var dv=document.getElementById(\"d10570\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"http:\/\/www.rjmprogramming.com.au\/wordpress\/?tag=Firefox\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d10570' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n","protected":false},"excerpt":{"rendered":"<p>Today&#8217;s tutorial looks at the scenario of webpages &#8220;virtually&#8221; just made up of Javascript &#8230; &#8220;virtually&#8221; because we&#8217;ve stopped short of turning this into a bookmarklet. Today we write the Tic Tac Toe game in Javascript &#8220;virtually&#8221; only. If you &hellip; <a href=\"https:\/\/www.rjmprogramming.com.au\/ITblog\/firefox-scratchpad-javascript-primer-tutorial\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12,37],"tags":[157,439,476,652,997,1102,1275,1319,1358],"class_list":["post-10570","post","type-post","status-publish","format-standard","hentry","category-elearning","category-tutorials","tag-bookmarklet","tag-firefox","tag-game","tag-javascript","tag-programming","tag-scratchpad","tag-tic-tac-toe","tag-tutorial","tag-validation"],"_links":{"self":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/10570"}],"collection":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/comments?post=10570"}],"version-history":[{"count":0,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/10570\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/media?parent=10570"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/categories?post=10570"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/tags?post=10570"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}