{"id":54880,"date":"2022-02-12T03:01:29","date_gmt":"2022-02-11T17:01:29","guid":{"rendered":"http:\/\/www.rjmprogramming.com.au\/ITblog\/?p=54880"},"modified":"2022-02-12T07:46:34","modified_gmt":"2022-02-11T21:46:34","slug":"start-word-suggestions-for-wordle-iframe-tutorial","status":"publish","type":"post","link":"https:\/\/www.rjmprogramming.com.au\/ITblog\/start-word-suggestions-for-wordle-iframe-tutorial\/","title":{"rendered":"Start Word Suggestions for Wordle Iframe Tutorial"},"content":{"rendered":"<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/start_word_for_wordle_helper.php\"><img decoding=\"async\" style=\"border: 15px solid pink;\" alt=\"Start Word Suggestions for Wordle Iframe Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/PHP\/start_word_for_wordle_helper_iframe.jpg\" title=\"Start Word Suggestions for Wordle Iframe Tutorial\"  style=\"float:left;\"   \/><\/a><p class=\"wp-caption-text\">Start Word Suggestions for Wordle Iframe Tutorial<\/p><\/div>\n<p>Yesterday&#8217;s <a title='Start Word Suggestions for Wordle Styling and Scripting Tutorial' href='#swswsst'>Start Word Suggestions for Wordle Styling and Scripting Tutorial<\/a>&#8216;s presentation used a hashtag navigation link, &#8220;<a href='#myswh' title='Below'>or below<\/a>&#8220;, to take the user to an HTML iframe hosted execution of our current web application of interest.   Sometimes in such a scenario, you might be dealing with a vastly reduced width and\/or height to work with, and find your presentation to this iframe appears a bit too wide or too high.  And so, today, we outline an idea or two about how to handle that.<\/p>\n<ol>\n<li>decide on a strategy for &#8220;iframe&#8221; modus operandi CSS styling improvement or HTML design improvement or Javascript DOM dynamic styling improvement &#8230; we&#8217;ve decided, today &#8230;<\/li>\n<li>for &#8220;iframe&#8221; modus operandi we want to reduce width by turning the &#8220;h1&#8221; element into an &#8220;h2&#8221; element &#8230; which amounts to an <i>HTML design improvement<\/i> implemented via a Javascript DOM action conduit, as per &#8230;<\/li>\n<li>decide on an intervention point for that <i>Javascript DOM action conduit<\/i> &#8230; you guessed it &#8230; document.body onload event <font color=blue>as the webpage loads<\/font> &#8230;<br \/>\n&lt;?php<br \/>\n<code><br \/>\necho \"&lt;html&gt;\" . $hsc . \"&lt;body<font color=blue> onload=onl();<\/font>&gt;&lt;h1&gt;&lt;span&gt;Start five letter word for &lt;a target=_blank href='\/\/www.powerlanguage.co.uk\/wordle\/'&gt;Wordle&lt;\/a&gt; ... &lt;\/span&gt;&lt;input onclick=mixitup(); title='Allow for Unique Letters, Weirdness Sorting' type=button style=display:inline-block; value='via '&gt;&lt;\/input&gt;&lt;\/span&gt;&lt;form id=myform style=display:inline-block; action=.\/start_word_for_wordle_helper.php method=POST&gt;&lt;input id=mysub type=submit value=Submit style=display:none;&gt;&lt;\/input&gt;&lt;select style=display:inline-block; id=sugnum name=sugnum onchange=document.getElementById('mysub').click();&gt;&lt;option id=defopt value=-\" . $sugnum . \"&gt;\" . $sugnum . \"&lt;\/option&gt;&lt;option value=1&gt;1&lt;\/option&gt;&lt;option value=2&gt;2&lt;\/option&gt;&lt;option value=3&gt;3&lt;\/option&gt;&lt;option value=4&gt;4&lt;\/option&gt;&lt;option value=5&gt;5&lt;\/option&gt;&lt;option value=6&gt;6&lt;\/option&gt;&lt;option value=7&gt;7&lt;\/option&gt;&lt;option value=8&gt;8&lt;\/option&gt;&lt;option value=9&gt;9&lt;\/option&gt;&lt;option value=10&gt;10&lt;\/option&gt;&lt;option value=20&gt;20&lt;\/option&gt;&lt;option value=25&gt;25&lt;\/option&gt;&lt;option value=50&gt;50&lt;\/option&gt;&lt;option value=100&gt;100&lt;\/option&gt;&lt;\/select&gt;&lt;span&gt; suggestions ...&lt;\/span&gt;&lt;\/h1&gt;&lt;h3&gt;RJM Programming ... February, 2022&lt;\/h3&gt;&lt;h4&gt;Suggestions below (bigger associated number, the weirder is the suggestion) ...&lt;\/h4&gt;&lt;br&gt;\" . $tablebit . \"&lt;\/body&gt;&lt;\/html&gt;\";<br \/>\n<\/code><br \/>\n?&gt;<br \/>\n &#8230; then &#8230;<\/li>\n<li>write the new Javascript document.body onload event logic &#8230;<br \/>\n&lt;?php echo &#8221;<br \/>\n<code><br \/>\n  function onl() {<br \/>\n   if (window.self !== window.top) {<br \/>\n    document.body.innerHTML = ('' + document.body.innerHTML).replace(\/h1\/g, 'h2');<br \/>\n   }<br \/>\n  }<br \/>\n<\/code><br \/>\n&#8220;; ?&gt;<br \/>\n &#8230; a total &#8220;document.body.innerHTML&#8221; (content) solution working here (but is not always a good solution) to change the &#8220;type&#8221; of an element\n<\/li>\n<\/ol>\n<p> &#8230; representing a &#8220;hosting mode of use&#8221; style variation with <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/Geographicals\/diff.php?one=http:\/\/www.rjmprogramming.com.au\/PHP\/start_word_for_wordle_helper.php--GETME\">our changed<\/a> <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/start_word_for_wordle_helper.php--GETME\" title=\"start_word_for_wordle_helper.php\">start_word_for_wordle_helper.php<\/a> <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/start_word_for_wordle_helper.php\" title=\"Click picture\">live run<\/a> link, <a href='#myswh' title='Below'>or below<\/a>, web application!<\/p>\n<p><!--p>You can also see this play out at WordPress 4.1.1's <a target=_blank  href='\/\/www.rjmprogramming.com.au\/ITblog\/start-word-suggestions-for-wordle-iframe-tutorial\/'>Start Word Suggestions for Wordle Iframe Tutorial<\/a>.<\/p-->\n<hr>\n<p id='swswsst'>Previous relevant <a target=_blank title='Start Word Suggestions for Wordle Styling and Scripting Tutorial' href='\/\/www.rjmprogramming.com.au\/ITblog\/start-word-suggestions-for-wordle-styling-and-scripting-tutorial\/'>Start Word Suggestions for Wordle Styling and Scripting Tutorial<\/a> is shown below.<\/p>\n<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/start_word_for_wordle_helper.php\"><img decoding=\"async\" style=\"border: 15px solid pink;\" alt=\"Start Word Suggestions for Wordle Styling and Scripting Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/PHP\/start_word_for_wordle_helper.gif\" title=\"Start Word Suggestions for Wordle Styling and Scripting Tutorial\"  style=\"float:left;\"   \/><\/a><p class=\"wp-caption-text\">Start Word Suggestions for Wordle Styling and Scripting Tutorial<\/p><\/div>\n<p>Yesterday&#8217;s <a title='Start Word Suggestions for Wordle Primer Tutorial' href='#swswpt'>Start Word Suggestions for Wordle Primer Tutorial<\/a> proof of concept &#8220;Start Five Letter Word for <a target=_blank title=Wordle href='https:\/\/www.powerlanguage.co.uk\/wordle\/'>Wordle<\/a> Suggester&#8221; web application managed to create a workable webpage that did not need a <a target=_blank title='HTML head element information from W3schools' href='https:\/\/www.w3schools.com\/tags\/tag_head.asp'>&#8220;head&#8221;<\/a> element.  What are you missing with no &#8220;head&#8221; element?  Primarily &#8230;<\/p>\n<ul>\n<li>scripting (usually <a target=_blank title='HTML script element information from W3schools' href='https:\/\/www.w3schools.com\/tags\/tag_script.asp'>via<\/a> Javascript)<\/li>\n<li>styling (<a target=_blank title='HTML style element information from W3schools' href='https:\/\/www.w3schools.com\/tags\/tag_style.asp'>via<\/a> CSS)<\/li>\n<\/ul>\n<p> &#8230; and, perhaps a webpage title element, and, perhaps <a target=_blank title='HTML meta element information from W3schools' href='https:\/\/www.w3schools.com\/tags\/tag_meta.asp'>&#8220;meta&#8221;<\/a> elements like <a target=_blank title='HTML responsive design information from W3schools' href='https:\/\/www.w3schools.com\/css\/css_rwd_viewport.asp'>&#8220;meta viewport&#8221;<\/a> elements that help with mobile device display (improved visibility, for us).<\/p>\n<p>Within the PHP code we introduced some of all these improvements via &#8230;<\/p>\n<p>&lt;?php<br \/>\n<code><br \/>\n$hsc=\"&lt;head&gt;<br \/>\n&lt;title&gt;Start five letter word for Wordle - RJM Programming - February, 2022&lt;\/title&gt;<br \/>\n&lt;meta id='myviewport' name='viewport' content='width=device-width, initial-scale=1, minimum-scale=0.1, maximum-scale=8, user-scalable=yes' &gt;<br \/>\n&lt;style&gt;<br \/>\n  td {<br \/>\n    text-align: center;<br \/>\n  }<br \/>\n<br \/>\n  td:nth-child(2n+1) {<br \/>\n    background-color: #f3f7fa;<br \/>\n  }<br \/>\n<br \/>\n  th:nth-child(2n+1) {<br \/>\n    background-color: #f3f7fa;<br \/>\n  }<br \/>\n<br \/> <br \/>\n  body {<br \/>\n    background-color: #f7f7f7;<br \/>\n  }<br \/>\n&lt;\/style&gt;<br \/>\n&lt;script type='text\/javascript'&gt;<br \/>\n  var wois=null;<br \/>\n  function mixitup() {<br \/>\n   var others=prompt('Space separate the word(s) \\\"sort\\\" to sort for Weirdness and\/or \\\"unique\\\" for five letter words with no repeated letters.   Optionally precede by that number of five letter word suggestions to create for use with Wordle, followed by a space character.', '');<br \/>\n   var clickthis='';<br \/>\n   if (others == null) { others=''; }<br \/>\n<br \/>   others=others.replace(String.fromCharCode(34),'').replace(String.fromCharCode(34),'').replace(String.fromCharCode(34),'').replace(String.fromCharCode(34),'').replace(String.fromCharCode(34),'').replace(String.fromCharCode(34),'').replace(String.fromCharCode(34),'').replace(String.fromCharCode(34),'');<br \/>\n   others=others.toLowerCase().replace('sort',' sort').replace('uniqu',' uniqu');<br \/>\n   if (others.trim() != '') {<br \/>\n     var aothers=others.trim().split(' ');<br \/>\n     if (aothers[0].replace(\/0\/g,'').replace(\/1\/g,'').replace(\/2\/g,'').replace(\/3\/g,'').replace(\/4\/g,'').replace(\/5\/g,'').replace(\/6\/g,'').replace(\/7\/g,'').replace(\/8\/g,'').replace(\/9\/g,'') == '') {<br \/>\n        document.getElementById('defopt').value='-' + aothers[0];<br \/>\n        document.getElementById('defopt').innerHTML=aothers[0];<br \/>\n        document.getElementById('sugnum').value='-' + aothers[0];<br \/>\n        others=others.replace(aothers[0],'').trim();<br \/>\n        clickthis='mysub';<br \/>\n     }<br \/>\n   }<br \/>\n   if (others.trim() != '') {<br \/>\n     var sv=document.getElementById('sugnum').value;<br \/>\n     document.getElementById('myform').innerHTML+='&lt;input type=hidden name=others value=\\\"' + others + '\\\"&gt;&lt;\/input&gt;';<br \/>\n     document.getElementById('sugnum').value=sv;<br \/>\n   }<br \/>\n   if (clickthis != '') {  document.getElementById(clickthis).click();  }<br \/>\n  }<br \/>\n<br \/> <br \/>\n&lt;\/script&gt;<br \/>\n&lt;\/head&gt;\";<br \/>\n<\/code><br \/>\n?&gt;<\/p>\n<p>It allows us to offer &#8220;sort&#8221; (via word weirdness) and &#8220;uniquify&#8221; (to enforce unique letter sets per five letter word) additional functionality.  We hope you try <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/Geographicals\/diff.php?one=http:\/\/www.rjmprogramming.com.au\/PHP\/start_word_for_wordle_helper.php-GETME\">the changed<\/a> <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/start_word_for_wordle_helper.php-GETME\" title=\"start_word_for_wordle_helper.php\">start_word_for_wordle_helper.php<\/a> <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/start_word_for_wordle_helper.php\" title=\"Click picture\">live run<\/a> link, <a href='#myswh' title='Below'>or below<\/a>, to try out these improvements.<\/p>\n<p><!--p>You can also see this play out at WordPress 4.1.1's <a target=_blank  href='\/\/www.rjmprogramming.com.au\/ITblog\/start-word-suggestions-for-wordle-styling-and-scripting-tutorial\/'>Start Word Suggestions for Wordle Styling and Scripting Tutorial<\/a>.<\/p-->\n<hr>\n<p id='swswpt'>Previous relevant <a target=_blank title='Start Word Suggestions for Wordle Primer Tutorial' href='\/\/www.rjmprogramming.com.au\/ITblog\/start-word-suggestions-for-wordle-primer-tutorial\/'>Start Word Suggestions for Wordle Primer Tutorial<\/a> is shown below.<\/p>\n<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/start_word_for_wordle_helper.php\"><img decoding=\"async\" style=\"border: 15px solid pink;\" alt=\"Start Word Suggestions for Wordle Primer Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/PHP\/start_word_for_wordle_helper.jpg\" title=\"Start Word Suggestions for Wordle Primer Tutorial\"  style=\"float:left;\"   \/><\/a><p class=\"wp-caption-text\">Start Word Suggestions for Wordle Primer Tutorial<\/p><\/div>\n<p>A new word game is an interesting phenomenon.  Are you a regular <a target=_blank title=Wordle href='https:\/\/www.powerlanguage.co.uk\/wordle\/'>&#8220;Wordle&#8221;<\/a> player?  We tried it the other day, and see why it&#8217;s addictive.  But it seems to us, a lot relies on that first five letter word guess you make.<\/p>\n<p>And so we decided to try to help out, at least in English, by accessing the macOS and Linux dictionary resources, and add in a &#8220;weirdness score&#8221;, the scoring for which we adopt a &#8220;Scrabble stance&#8221;.   Interested?  Try <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/start_word_for_wordle_helper.php\">start_word_for_wordle_helper.php<\/a>&#8216;s <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/start_word_for_wordle_helper.php\">live run<\/a>, or below &#8230;<\/p>\n<p><iframe id=myswh src=\"http:\/\/www.rjmprogramming.com.au\/PHP\/start_word_for_wordle_helper.php?others=10sortunique\" style=\"width:100%;height:800px;\"><\/iframe><\/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='#d54864' onclick='var dv=document.getElementById(\"d54864\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/word\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d54864' 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='#d54868' onclick='var dv=document.getElementById(\"d54868\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/javascript\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d54868' 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='#d54880' onclick='var dv=document.getElementById(\"d54880\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/type\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d54880' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n","protected":false},"excerpt":{"rendered":"<p>Yesterday&#8217;s Start Word Suggestions for Wordle Styling and Scripting Tutorial&#8216;s presentation used a hashtag navigation link, &#8220;or below&#8220;, to take the user to an HTML iframe hosted execution of our current web application of interest. Sometimes in such a scenario, &hellip; <a href=\"https:\/\/www.rjmprogramming.com.au\/ITblog\/start-word-suggestions-for-wordle-iframe-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":[281,326,354,2212,587,652,776,932,997,1105,1106,1209,1212,2167,1319,1373,1452,1453,3905],"class_list":["post-54880","post","type-post","status-publish","format-standard","hentry","category-elearning","category-tutorials","tag-css","tag-dictionary","tag-dom","tag-head","tag-iframe","tag-javascript","tag-meta","tag-php","tag-programming","tag-script","tag-scripting","tag-style","tag-styling","tag-title","tag-tutorial","tag-viewport","tag-word","tag-word-game","tag-wordle"],"_links":{"self":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/54880"}],"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=54880"}],"version-history":[{"count":7,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/54880\/revisions"}],"predecessor-version":[{"id":54887,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/54880\/revisions\/54887"}],"wp:attachment":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/media?parent=54880"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/categories?post=54880"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/tags?post=54880"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}