{"id":14605,"date":"2015-05-03T05:01:29","date_gmt":"2015-05-02T19:01:29","guid":{"rendered":"http:\/\/www.rjmprogramming.com.au\/ITblog\/?p=14605"},"modified":"2015-05-02T22:45:03","modified_gmt":"2015-05-02T12:45:03","slug":"html5-meter-element-word-count-tutorial","status":"publish","type":"post","link":"https:\/\/www.rjmprogramming.com.au\/ITblog\/html5-meter-element-word-count-tutorial\/","title":{"rendered":"HTML5 Meter Element Word Count Tutorial"},"content":{"rendered":"<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/content_bargraph.php\"><img decoding=\"async\" style=\"float:left;border: 15px solid pink;\" alt=\"HTML5 Meter Element Word Count Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/PHP\/content_bargraph.jpg\" title=\"HTML5 Meter Element Word Count Tutorial\"   \/><\/a><p class=\"wp-caption-text\">HTML5 Meter Element Word Count Tutorial<\/p><\/div>\n<p>HTML5 brought with it many great features to front-end work on the internet in HTML, and today, we continue on from the previous <a target=_blank title='HTML5 Meter Element Primer Tutorial' href='#hmepbt'>HTML5 Meter Element Progress Bar Tutorial<\/a> as shown below, we talk about one of the newly introduced, and very useful, elements called <a target=_blank title='HTML5 meter tag information from w3schools' href='http:\/\/www.w3schools.com\/tags\/tag_meter.asp'><i>&#8220;&lt;meter&gt;&#8221;<\/i><\/a>, and use a lot of the same methods with a different &#8220;web application&#8221; engine (and lots of the knowledge from <a target=_blank title='PHP\/HTML Google Chart Wordtree Chart Local File Tutorial' href='https:\/\/www.rjmprogramming.com.au\/ITblog\/phpjavascripthtml-google-chart-wordtree-chart-local-file-tutorial\/'>PHP\/HTML Google Chart Wordtree Chart Local File Tutorial<\/a>), to show webpage content word counts (with the weakness that only English character sets are catered for &#8230; apologies for that), with a progress bar, and a (Google Chart) Bar Chart.  By the way, the <i>&#8220;&lt;meter&gt;&#8221;<\/i> element does not work with mobile Safari, as one example, and you can read more about this <a target=_blank title='Meter HTML5 element does not work with mobile Safari' href='http:\/\/stackoverflow.com\/questions\/10039676\/html5-meter-in-mobile-safari'>here<\/a>.<\/p>\n<p>As we outlined back then, that at its core, the <i>&#8220;&lt;meter&gt;&#8221;<\/i> element represents a &#8220;fraction of one&#8221; or perhaps you can think this as a &#8220;percentage of one hundred&#8221;, and, as you&#8217;d guess, a generic &#8220;x<sup>th<\/sup> of y for the fraction x\/y&#8221; idea &#8230; where &#8220;y&#8221; could be your &#8220;max&#8221; parameter, and perhaps your &#8220;min&#8221; parameter is zero.  Today we extend that &#8220;fraction&#8221; concept to being a &#8220;fraction&#8221; of completion time, as a progress bar.<\/p>\n<p>Probably don&#8217;t need to tell you that progress bars are popular features of the internet.  Sometimes, it can be quite hard to predict when some jobs will finish &#8230; suppose you base it on a file size &#8230; but this may not take into account record sizes or intensity of calculation for particular data record types etcetera etcetera etcetera.<\/p>\n<p>With our progress bar today we analyze the words used in a web page&#8217;s content and show a few of the most commonly used words (the length of which you can restrict a bit, as the user) appearing in that webpage and present this as a (Google Chart) bar chart, that changes along with the progress bar &#8220;progressing&#8221;.<\/p>\n<p>So take a look at the PHP code in <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/content_bargraph.php_GETME\" title=\"content_bargraph.php\">content_bargraph.php<\/a>, or a <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/content_bargraph.php\" title=\"live run\">live run<\/a>, for your perusal.  Hope you get to try out the ideas presented today with a home-grown project of your own.<\/p>\n<hr>\n<p id='hmepbt'>Previous relevent <a target=_blank title='HTML5 Meter Element Progress Bar Tutorial' href='https:\/\/www.rjmprogramming.com.au\/ITblog\/?p=14573'>HTML5 Meter Element Progress Bar 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\/image_bargraph.php\"><img decoding=\"async\" style=\"float:left;border: 15px solid pink;\" alt=\"HTML5 Meter Element Progress Bar Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/PHP\/image_bargraph.jpg\" title=\"HTML5 Meter Element Progress Bar Tutorial\"   \/><\/a><p class=\"wp-caption-text\">HTML5 Meter Element Progress Bar Tutorial<\/p><\/div>\n<p>HTML5 brought with it many great features to front-end work on the internet in HTML, and today, we continue on from yesterday&#8217;s <a target=_blank title='HTML5 Meter Element Primer Tutorial' href='#hmept'>HTML5 Meter Element Primer Tutorial<\/a> as shown below, we talk about one of the newly introduced, and very useful, elements called <a target=_blank title='HTML5 meter tag information from w3schools' href='http:\/\/www.w3schools.com\/tags\/tag_meter.asp'><i>&#8220;&lt;meter&gt;&#8221;<\/i><\/a>.  By the way, the <i>&#8220;&lt;meter&gt;&#8221;<\/i> element does not work with mobile Safari, for instance, and you can read more about this <a target=_blank title='Meter HTML5 element does not work with mobile Safari' href='http:\/\/stackoverflow.com\/questions\/10039676\/html5-meter-in-mobile-safari'>here<\/a>.<\/p>\n<p>As we outlined yesterday, at its core the <i>&#8220;&lt;meter&gt;&#8221;<\/i> element represents a &#8220;fraction of one&#8221; or perhaps you can think this as a &#8220;percentage of one hundred&#8221;, and, as you&#8217;d guess, a generic &#8220;x<sup>th<\/sup> of y for the fraction x\/y&#8221; idea &#8230; where &#8220;y&#8221; could be your &#8220;max&#8221; parameter, and perhaps your &#8220;min&#8221; parameter is zero.  Today we extend that &#8220;fraction&#8221; concept to being a &#8220;fraction&#8221; of completion time, as a progress bar.<\/p>\n<p>Progress bars appear all over the internet.  Personally I love the ones that go backwards, just like those mileposts that increase as you head closer to a town.  In defense of this occasional progress bar behaviour, it can be quite hard to predict when some jobs will finish &#8230; suppose you base it on a file size &#8230; but this may not take into account record sizes or intensity of calculation for particular data record types etcetera etcetera etcetera.<\/p>\n<p>With our progress bar today we analyze the pixels of a user-defined image file and show a few of the most commonly occurring pixel colours appearing in that image (file) and present this as a (Google Chart) bar chart, that changes along with the progress bar &#8220;progressing&#8221;.<\/p>\n<p>So take a look at the PHP code in <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/image_bargraph.php-GETME\" title=\"image_bargraph.php\">image_bargraph.php<\/a>, or a <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/image_bargraph.php\" title=\"live run\">live run<\/a>, for your perusal.  A useful PHP link for this was <a target=_blank title='Useful link' href='http:\/\/php.net\/manual\/en\/function.imagecolorat.php'>this one<\/a> &#8230; so, thanks.  Hope it helps with a project idea you are mulling over now.<\/p>\n<p><b>Stop Press:<\/b> The next tutorial in our sequence called <a target=_blank title='' href='https:\/\/www.rjmprogramming.com.au\/ITblog\/html5-meter-element-word-count-tutorial\/'>HTML5 Meter Element Word Count Tutorial<\/a> led to some thinking causing changes to our code above which you can see with the <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/Geographicals\/diff.php?one=http:\/\/www.rjmprogramming.com.au\/PHP\/image_bargraph.php-GETME\" title=\"image_bargraph.php\">image_bargraph.php<\/a> link.<\/p>\n<hr>\n<p id='hmept'>Previous relevant <a target=_blank title='HTML5 Meter Element Primer Tutorial' href='https:\/\/www.rjmprogramming.com.au\/ITblog\/?p=14561'>HTML5 Meter Element 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\/HTMLCSS\/meter.html\"><img decoding=\"async\" style=\"float:left;border: 15px solid pink;\" alt=\"HTML5 Meter Element Primer Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/meter.jpg\" title=\"HTML5 Meter Element Primer Tutorial\"   \/><\/a><p class=\"wp-caption-text\">HTML5 Meter Element Primer Tutorial<\/p><\/div>\n<p>HTML5 brought with it many great features to front-end work on the internet in HTML, and today we talk about one of the newly introduced, and very useful, elements called <a target=_blank title='HTML5 meter tag information from w3schools' href='http:\/\/www.w3schools.com\/tags\/tag_meter.asp'><i>&#8220;&lt;meter&gt;&#8221;<\/i><\/a>.<\/p>\n<p>At its core the <i>&#8220;&lt;meter&gt;&#8221;<\/i> element represents a &#8220;fraction of one&#8221; or perhaps you can think this as a &#8220;percentage of one hundred&#8221;, and, as you&#8217;d guess, a generic &#8220;x<sup>th<\/sup> of y for the fraction x\/y&#8221; idea &#8230; where &#8220;y&#8221; could be your &#8220;max&#8221; parameter, and perhaps your &#8220;min&#8221; parameter is zero.<\/p>\n<p>This element is useful to represent a numerical concept graphically (like a ratio), something we do today with &#8230;<\/p>\n<ul>\n<li>simulation of a stopwatch &#8230; with its seconds, minutes, hours, days, years elapsed<\/li>\n<li>a fraction as (numerator) x \/ y (denominator)<\/li>\n<\/ul>\n<p>Tomorrow we&#8217;ll show you a very commonplace usage for <i>&#8220;&lt;meter&gt;&#8221;<\/i> as a &#8220;progress bar&#8221; which you see so much of on the internet, when you are waiting for something.<\/p>\n<p>So take a look at the HTML code in <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/meter.html_GETME\" title=\"meter.html\">meter.html<\/a>, or a <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/meter.html\" title=\"live run\">live run<\/a>, for your perusal.  Hope it helps with an HTML project you are on now.<\/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='#14561' onclick='var dv=document.getElementById(\"d14561\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/?tag=HTML5\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d14561' 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='#14573' onclick='var dv=document.getElementById(\"d14573\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/?tag=GUI\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d14573' 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='#14605' onclick='var dv=document.getElementById(\"d14605\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/?tag=PHP\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d14605' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n","protected":false},"excerpt":{"rendered":"<p>HTML5 brought with it many great features to front-end work on the internet in HTML, and today, we continue on from the previous HTML5 Meter Element Progress Bar Tutorial as shown below, we talk about one of the newly introduced, &hellip; <a href=\"https:\/\/www.rjmprogramming.com.au\/ITblog\/html5-meter-element-word-count-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,17,37],"tags":[130,275,493,513,518,549,576,578,652,1517,1522,932,997,1521,1083,1200,1319,1418,1452,1526],"class_list":["post-14605","post","type-post","status-publish","format-standard","hentry","category-elearning","category-gui","category-tutorials","tag-bar-chart","tag-cross-browser","tag-gist","tag-google","tag-google-chart","tag-gui","tag-html","tag-html5","tag-javascript","tag-meter","tag-mobile-safari","tag-php","tag-programming","tag-progress-bar","tag-safari","tag-stop-press","tag-tutorial","tag-webpage","tag-word","tag-word-count"],"_links":{"self":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/14605"}],"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=14605"}],"version-history":[{"count":6,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/14605\/revisions"}],"predecessor-version":[{"id":14619,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/14605\/revisions\/14619"}],"wp:attachment":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/media?parent=14605"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/categories?post=14605"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/tags?post=14605"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}