{"id":69033,"date":"2025-08-10T03:01:00","date_gmt":"2025-08-09T17:01:00","guid":{"rendered":"https:\/\/www.rjmprogramming.com.au\/ITblog\/?p=69033"},"modified":"2025-08-09T21:16:26","modified_gmt":"2025-08-09T11:16:26","slug":"write-like-you-render-primer-tutorial","status":"publish","type":"post","link":"https:\/\/www.rjmprogramming.com.au\/ITblog\/write-like-you-render-primer-tutorial\/","title":{"rendered":"Write Like You Render Primer Tutorial"},"content":{"rendered":"<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/write_like_you_render.html\" rel=\"noopener\"><img decoding=\"async\" style=\"border: 15px solid pink;\" alt=\"Write Like You Render Primer Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/write_like_you_render.png\" title=\"Write Like You Render Primer Tutorial\"  style=\"float:left;\"  \/><\/a><p class=\"wp-caption-text\">Write Like You Render Primer Tutorial<\/p><\/div>\n<p>The recent goings on with the <a target=\"_blank\" title='' href='https:\/\/www.rjmprogramming.com.au\/ITblog\/youtube-style-subrip-subtitles-button-tutorial\/' rel=\"noopener\">YouTube Style SubRip Subtitles Button Tutorial<\/a> thread of blog postings, uncovering for us the wonders of the great <a target=\"_blank\" title='DOMParser Web API information' href='https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/API\/DOMParser' rel=\"noopener\">DOMParser<\/a> Web API, has inspired us to write, <a target=\"_blank\" title=\"?\" href='https:\/\/www.youtube.com\/watch?v=e9_7GcQeiqw&#038;t=2m37s' rel=\"noopener\">again<\/a>, a new HTML validator web application, just on the clientside of the &#8220;webpage equation&#8221;.<\/p>\n<p>If you are into the creation of HTML on a Content Management System such as <a target=\"_blank\" title='WordPress.org ... your hosting' href='http:\/\/www.wordpress.org' rel=\"noopener\">WordPress<\/a>, here, with this blog, there is some forgiveness regarding what you construct as your content HTML and allowing that through to webpage content.  But perhaps you&#8217;d &#8230;<\/p>\n<blockquote><p>\nLike to write the HTML as the web browser sees it, and then renders it\n<\/p><\/blockquote>\n<p>It mattered, a lot, in that project above, because for that project&#8217;s &#8220;collaboration purposes&#8221;, in the code, we wanted to know that HTML content in the caption data relevant &#8220;shadowing&#8221; textarea or textbox user interfacing elements would match any HTML element &#8220;innerHTML&#8221; or &#8220;outerHTML&#8221; or &#8220;innerText&#8221; reference later accessed.  Any missing double quote mattered in this scenario.  But, of course, it would be good as general practice for a Content Management System produced set of HTML to get close to that ideal HTML the web browser syntax in it&#8217;s form and format.<\/p>\n<p>Which brings us to today&#8217;s &#8230;<\/p>\n<p><code><br \/>\nWrite Like You Render<br \/>\n<\/code><\/p>\n<p> &#8230; web application HTML validator <a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/write_like_you_render.html_GETME\" rel=\"noopener\">&#8220;first draft&#8221; write_like_you_render.html<\/a> with the starring codelines &#8230;<\/p>\n<p><code><br \/>\n      var newh=new DOMParser().parseFromString(inhtml, \"text\/html\"); \/\/ thanks to <a target=\"_blank\" title='https:\/\/stackoverflow.com\/questions\/57074776\/parse-html-string-to-dom-and-convert-it-back-to-string' href='https:\/\/stackoverflow.com\/questions\/57074776\/parse-html-string-to-dom-and-convert-it-back-to-string' rel=\"noopener\">https:\/\/stackoverflow.com\/questions\/57074776\/parse-html-string-to-dom-and-convert-it-back-to-string<\/a><br \/>\n      var newht=('' + newh.body.innerHTML);<br \/>\n<\/code><\/p>\n<p> &#8230; you can try for yourself <a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/write_like_you_render.html\" rel=\"noopener\">here<\/a> or below &#8230;<\/p>\n<p><iframe style=\"width:100%;height:1200px;\" src=\"\/\/www.rjmprogramming.com.au\/HTMLCSS\/write_like_you_render.html\"><\/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='#d69033' onclick='var dv=document.getElementById(\"d69033\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/validation\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d69033' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n","protected":false},"excerpt":{"rendered":"<p>The recent goings on with the YouTube Style SubRip Subtitles Button Tutorial thread of blog postings, uncovering for us the wonders of the great DOMParser Web API, has inspired us to write, again, a new HTML validator web application, just &hellip; <a href=\"https:\/\/www.rjmprogramming.com.au\/ITblog\/write-like-you-render-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":[1848,12,14,37],"tags":[218,1849,2147,342,5233,576,652,2165,894,997,1049,2386,1262,1319,1357,1358],"class_list":["post-69033","post","type-post","status-publish","format-standard","hentry","category-software-coding","category-elearning","category-event-driven-programming","category-tutorials","tag-code","tag-coding","tag-delimiter","tag-div","tag-domparser","tag-html","tag-javascript","tag-mark","tag-overlay","tag-programming","tag-render","tag-syntax","tag-textarea","tag-tutorial","tag-validate","tag-validation"],"_links":{"self":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/69033"}],"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=69033"}],"version-history":[{"count":12,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/69033\/revisions"}],"predecessor-version":[{"id":69062,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/69033\/revisions\/69062"}],"wp:attachment":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/media?parent=69033"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/categories?post=69033"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/tags?post=69033"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}