{"id":5759,"date":"2014-01-02T05:09:42","date_gmt":"2014-01-01T18:09:42","guid":{"rendered":"http:\/\/www.rjmprogramming.com.au\/wordpress\/?p=5759"},"modified":"2014-01-02T05:09:42","modified_gmt":"2014-01-01T18:09:42","slug":"htmljavascript-animal-categorization-tutorial","status":"publish","type":"post","link":"https:\/\/www.rjmprogramming.com.au\/ITblog\/htmljavascript-animal-categorization-tutorial\/","title":{"rendered":"HTML\/Javascript Animal Categorization Tutorial"},"content":{"rendered":"<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/ConfirmWindow\/AnimalCategorization.m4v\"><img decoding=\"async\" style=\"float:left;border: 15px solid pink;\" alt=\"HTML\/Javascript Animal Categorization Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/ConfirmWindow\/AnimalCategorization.jpg\" title=\"HTML\/Javascript Animal Categorization Tutorial\" \/><\/a><p class=\"wp-caption-text\">HTML\/Javascript Animal Categorization Tutorial<\/p><\/div>\n<p>A lot of the issues worth thinking about in the world can not be reduced to yes\/no or 0\/1 decisions.  Even so, we often yearn to model it that way.  After all, a computer is really a supermachine reducing problems down to binary fundamental &#8220;bits&#8221; (chortle, chortle).   Sometimes really complex problems work well broken down this way.    For such problems, their design can be shown graphically very well with <a target=_blank title='Flowchart information from Wikipedia' href='http:\/\/en.wikipedia.org\/wiki\/Flowchart'>flowcharts<\/a>.<\/p>\n<p>In Javascript the window.confirm Popup box is good for the Yes\/No or OK\/Cancel (button) interactive questions the website requires from the web user.   Today we use the window.confirm Popup box to categorize animals &#8230; thanks to this <a target=_blank href='http:\/\/groups.engin.umd.umich.edu\/CIS\/course.des\/cis579\/animal.txt' title='Animal Categorization logic'>link<\/a> for the source data for the idea.<\/p>\n<p>This tutorial also goes some way towards internationalization by arranging for it to be supervised by <a target=_blank title='Google Translate' href='http:\/\/translate.google.com'>Google Translate<\/a>.   Wasn&#8217;t sure about what would happen with hard-coded English parameters to the window.confirm Popup box supervised by Google Translate, and it panned out not to be translated, so a different technique was used.  The window.confirm Popup box parameters are gleaned from the [HTMLObject].innerHTML of some hidden <i>p<\/i> elements with the base English.   Again, not quite there, and there is a bit more to do, because Google Translate fleshes out the [HTMLObject].innerHTML&#8217;s with its own brilliance (span elements everywhere &#8230; very clever) &#8230; so to tailor it better for our needs we filter it through a Javascript function that only returns the string outside the &lt; and &gt; parts of the string (and thought leaving the English in as well as the non-English was a feature, not a pest &#8230; you may disagree?!).<\/p>\n<p>Let&#8217;s see some  HTML code in <a target=_blank title='Animal Categorization run' href='http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/ConfirmWindow\/animal_categorization.html'>live action<\/a> for this tutorial where you define your known animal characteristics.<\/p>\n<p>Other tutorials of help for this tutorial &#8230; thanks &#8230; were &#8230;<\/p>\n<ul>\n<li><a target=_blank href='http:\/\/groups.engin.umd.umich.edu\/CIS\/course.des\/cis579\/animal.txt' title='Animal Categorization logic'>Animal Categorization logic &#8230; thanks a lot<\/a><\/li>\n<li><a target=_blank href='http:\/\/www.w3schools.com\/js\/js_popup.asp' title='JavaScript Popup Boxes'>JavaScript Popup Boxes<\/a><\/li>\n<li><a target=_blank href='https:\/\/encrypted-tbn2.gstatic.com\/images?q=tbn:ANd9GcSUboJ3Mi82vFFE38ijJ0493ev6f4Wqpvx9eU7_W-ZU9wjMswV2uQ' title='Free background image ... thanks'>Free background image &#8230; thanks<\/a><\/li>\n<\/ul>\n<p>Link to some downloadable HTML programming code &#8230; rename to <a target=_blank href='http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/ConfirmWindow\/animal_categorization.html-GETME' title='Download me'>animal_categorization.html<\/a><\/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='#d5759' onclick='var dv=document.getElementById(\"d5759\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"http:\/\/www.rjmprogramming.com.au\/wordpress\/?s=Javascript\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d5759' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n","protected":false},"excerpt":{"rendered":"<p>A lot of the issues worth thinking about in the world can not be reduced to yes\/no or 0\/1 decisions. Even so, we often yearn to model it that way. After all, a computer is really a supermachine reducing problems &hellip; <a href=\"https:\/\/www.rjmprogramming.com.au\/ITblog\/htmljavascript-animal-categorization-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":[250,532,564,576,620,652,997,1304,1319],"class_list":["post-5759","post","type-post","status-publish","format-standard","hentry","category-elearning","category-tutorials","tag-confirm-popup-box","tag-google-translate","tag-hierarchy","tag-html","tag-internationalization","tag-javascript","tag-programming","tag-tree","tag-tutorial"],"_links":{"self":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/5759"}],"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=5759"}],"version-history":[{"count":0,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/5759\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/media?parent=5759"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/categories?post=5759"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/tags?post=5759"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}