{"id":5781,"date":"2014-01-05T05:01:35","date_gmt":"2014-01-04T18:01:35","guid":{"rendered":"http:\/\/www.rjmprogramming.com.au\/wordpress\/?p=5781"},"modified":"2014-01-05T05:01:35","modified_gmt":"2014-01-04T18:01:35","slug":"safari-ipad-issue-with-window-open-and-window-location-primer-tutorial","status":"publish","type":"post","link":"https:\/\/www.rjmprogramming.com.au\/ITblog\/safari-ipad-issue-with-window-open-and-window-location-primer-tutorial\/","title":{"rendered":"Safari iPad Issue with Window.Open and Window.Location Primer Tutorial"},"content":{"rendered":"<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/ConfirmWindow\/animal_categorization.html\"><img decoding=\"async\" style=\"float:left;border: 15px solid pink;\" alt=\"Safari iPad Issue with Window.Open and Window.Location Primer Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/ConfirmWindow\/Safari_iPad_window_open.jpg\" title=\"Safari iPad Issue with Window.Open and Window.Location Primer Tutorial\" \/><\/a><p class=\"wp-caption-text\">Safari iPad Issue with Window.Open and Window.Location Primer Tutorial<\/p><\/div>\n<p>The <a target=_blank title='HTML\/Javascript Animal Categorization Tutorial' href='#hjact'>HTML\/Javascript Animal Categorization Tutorial<\/a> as shown below 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>.   In doing this it tries to open a popup window.  We&#8217;ve said before that your browser may allow this or not, but if you are a Safari web browser user on an iPad and you allow popup boxes you can run into issues where some webpages can cause your Safari web browser to hang (and perhaps have to clear the history and cache, to get out of) once you get to the window as shown in the picture above, and you answer &#8220;Allow&#8221; or &#8220;Block&#8221;, it would appear (to me, at least).   One such troublesome webpage was the old incarnation of the tutorial below (we show the measures made to fix it below).<\/p>\n<p>The iOS devices, including the iPhone and iPad, may not recognize any Javascript <i>window.location=&#8230;;<\/i> you have in your code, and you should use <i>location.href=&#8230;;<\/i> instead (please see useful tutorial link below).   So, over time, here is a thing to do with a few tutorials and other pages, at this domain.<\/p>\n<p>So, it is not just a cross-browser &#8220;world&#8221;, it is (also) very much a cross-platform &#8220;world&#8221; to consider.<\/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 (amended) tutorial (so that it works on Safari iPad), as per tutorial below, where you define your known animal characteristics.<\/p>\n<p>Other tutorial of help for this tutorial &#8230; thanks &#8230; was &#8230;<\/p>\n<ul>\n<li><a target=_blank href='http:\/\/stackoverflow.com\/questions\/16714578\/use-of-window-location-doesnt-work-on-ipad' title=\"javascript - Use of window.location doesn't work on iPad - Stack Overflow\">javascript &#8211; Use of window.location doesn&#39;t work on iPad &#8211; Stack Overflow<\/a><\/li>\n<\/ul>\n<p>Here is a new link to some downloadable HTML programming source code explaining changes made (from tutorial below) to make it (also) work for Safari iPad users  <a target=_blank title='column_chart_diff.php' href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/Geographicals\/diff.php?one=http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/ConfirmWindow\/animal_categorization.html-GETME\">here<\/a>.<\/p>\n<hr \/>\n<p id='hjact'>Previous relevant <a target=_blank title='HTML\/Javascript Animal Categorization Tutorial' href='http:\/\/www.rjmprogramming.com.au\/wordpress\/?p=5759'>HTML\/Javascript Animal Categorization Tutorial<\/a> is shown below.<\/p>\n<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<hr \/>\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='#d5781' onclick='var dv=document.getElementById(\"d5781\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"http:\/\/www.rjmprogramming.com.au\/wordpress\/?cat=10\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d5781' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n","protected":false},"excerpt":{"rendered":"<p>The HTML\/Javascript Animal Categorization Tutorial as shown below goes some way towards internationalization by arranging for it to be supervised by Google Translate. In doing this it tries to open a popup window. We&#8217;ve said before that your browser may &hellip; <a href=\"https:\/\/www.rjmprogramming.com.au\/ITblog\/safari-ipad-issue-with-window-open-and-window-location-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,20,37],"tags":[275,278,630,652,968,997,1083,1319,1432,1433],"class_list":["post-5781","post","type-post","status-publish","format-standard","hentry","category-elearning","category-ios","category-tutorials","tag-cross-browser","tag-cross-platform","tag-ipad","tag-javascript","tag-popup-window","tag-programming","tag-safari","tag-tutorial","tag-window-location","tag-window-open"],"_links":{"self":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/5781"}],"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=5781"}],"version-history":[{"count":0,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/5781\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/media?parent=5781"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/categories?post=5781"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/tags?post=5781"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}