<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:media="http://search.yahoo.com/mrss/"
>

<channel>
	<title>Various Technical Articles to learn HTML5 with easy Examples</title>
	<atom:link href="https://jharaphula.com/category/programming-solutions/html5-examples/feed/" rel="self" type="application/rss+xml" />
	<link>https://jharaphula.com/category/programming-solutions/html5-examples/</link>
	<description>Blog for SEO Guest Posting, Digital Marketing or Home Remedies</description>
	<lastBuildDate>Tue, 14 Apr 2026 06:04:42 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9</generator>
	<item>
		<title>How to understand and Fix HTML Errors 404 or 401 or 403?</title>
		<link>https://jharaphula.com/how-to-understand-and-fix-html-errors/</link>
		
		<dc:creator><![CDATA[Rupamati Roy]]></dc:creator>
		<pubDate>Sun, 02 Jun 2024 15:32:26 +0000</pubDate>
				<category><![CDATA[Learn HTML5 with Examples]]></category>
		<category><![CDATA[Canvas in HTML5]]></category>
		<category><![CDATA[HTML Errors]]></category>
		<category><![CDATA[HTML5 Drag and Drop]]></category>
		<guid isPermaLink="false">https://jharaphula.com/?p=75028</guid>

					<description><![CDATA[<img width="300" height="184" src="https://jharaphula.com/wp-content/uploads/2024/06/error-page-300x184.jpg" class="webfeedsFeaturedVisual wp-post-image" alt="How to understand and Fix HTML Errors 404 or 401 or 403?" style="display: block; margin-bottom: 10px; clear: both; max-width: 100%;" decoding="async" fetchpriority="high" srcset="https://jharaphula.com/wp-content/uploads/2024/06/error-page-300x184.jpg 300w, https://jharaphula.com/wp-content/uploads/2024/06/error-page.jpg 610w" sizes="(max-width: 300px) 100vw, 300px" /><p>Why do all the HTML errors seem to have some kind of vague number rather than a real definition of what just happened while you...</p>
<p>The post <a href="https://jharaphula.com/how-to-understand-and-fix-html-errors/">How to understand and Fix HTML Errors 404 or 401 or 403?</a> appeared first on <a href="https://jharaphula.com">OneStop Shop</a>.</p>
]]></description>
										<content:encoded><![CDATA[<img width="300" height="184" src="https://jharaphula.com/wp-content/uploads/2024/06/error-page-300x184.jpg" class="webfeedsFeaturedVisual wp-post-image" alt="How to understand and Fix HTML Errors 404 or 401 or 403?" style="display: block; margin-bottom: 10px; clear: both; max-width: 100%;" decoding="async" srcset="https://jharaphula.com/wp-content/uploads/2024/06/error-page-300x184.jpg 300w, https://jharaphula.com/wp-content/uploads/2024/06/error-page.jpg 610w" sizes="(max-width: 300px) 100vw, 300px" /><p>Why do all the HTML errors seem to have some kind of vague number rather than a real definition of what just happened while you were trying to remove a website or upload your email? But numbers are commonplace, and discovering what is wrong with your computer requires digging deeper into our alternatives. Interestingly, many HTML errors such as 0x0 0x0 have the same causes or — at least — the same solutions.</p>
<h2>List of common HTML Errors</h2>
<h3>Error 400</h3>
<p>If you see a message like “400: Bad Request” or especially “<a href="https://jharaphula.com/err-too-many-redirects/" target="_blank" rel="noopener">HTTP 400 Error</a> — Bad Request” you can trust what you see. The request that you requested was incorrect in some way. Typing a URL in your browser is a signal to a computer that you are requesting a page from another computer, or server. If something goes wrong with the URL you entered, it can not load and give you an error.</p>
<p>While typing is certainly a possible 400 error, it is also possible that the page you are trying to access has been deleted, the URL has been copied incorrectly or is missing important items. The website may also have been updated.</p>
<h3>Error 401</h3>
<p>“401: Unauthorized” means you are not the person the website was hoping to see when you tried to sign in. Mistake 401 is a simple mistake — the visible door has just been slammed into your face for website security. If you did not log in to a website that requires users to enter their username and password, you will see Error 401. If you tried to log in, but the web server did not detect you, you mistyped something or something unusual. twist of fate, you will not be allowed to continue and you will be looking down Error 401 again.</p>
<h3>Error 403</h3>
<p>Naughty into! If you receive an Error 403 message, it means you have tried to access the part of the website that is completely banned, banned. Who knows what the webmaster is trying to hide behind a brick wall you just hit, but one thing is for sure — you will not proceed with that particular URL. At least not yet.</p>
<p>You could be calling Error 403 rather innocently, of course, but you are typing something wrong with the URL or maybe you are trying to access the website at the wrong time of day. This error does not mean that you have done something wrong … unless you have done something wrong.</p>
<h3>Error 404</h3>
<p>You may see any number of different error messages 404, but they will all have something in the “Error 404: Page Not Found”. You will see an error message 404 if you are trying to remove a webpage that is not actually on the server.</p>
<p>In general terms, Error 404 is said to be your fault, but in reality not all Error 404 messages appear due to user error. Pages may be inferior to a website or you may be trying to access a page that the website owner has removed or modified, and no one can blame you for that.</p>
<h3>Error 408</h3>
<p>Error 408 is a frustrating stumbling block especially on the internet. Type the URL or click the link. And wait. And wait. Then the website returns the error rather than the site you are trying to access. This Error 408 — “You Have an End Time.”</p>
<p>If you submit a website request and it does not load fast enough, the server stops. Instead of loading the site in question, it coughs up an error. Sometimes a quick recovery is helpful, but sometimes a strong connection is needed. To refresh your browser, click the round arrow next to the address bar.</p>
<h2>Fixing HTML Errors</h2>
<p>While there are many numbers caused by various online errors 0x0 0x0 above, many will have similar or similar solutions. If you do not find the website you are trying to access, problem solving involves some form of ground piercing.</p>
<h3>Check Internet Connection</h3>
<p>Do a quick check that you are getting full internet access by removing the search page and looking for something random. If you get results and you can click on those sites, you can skip the wrong internet out of your list of potential problems. If you do not come across any new websites, you may do well to reset your route and restart your computer to make sure you are fully connected to the Internet.</p>
<h3>Look at the obvious flaws</h3>
<p>Look at the address you just typed in and look for obvious errors — long URLs are especially difficult to spell correctly. If you miss a single letter or dot, you will not go far. Also note, especially in Error 403 where the password will be encrypted, that you do not have Caps Lock unlocked. Also check that the Number Lock is set to the default setting. If you find a valid error, just fix it and try again. The solution may be quite simple.</p>
<h3>Restart your computer</h3>
<p>Although it is suspected that the Internet is giving you a problem, not your computer, it does not hurt to restart the computer. When you restart your computer it may update some important software or reset the connection to the router so that your internet can work faster or faster. It’s easy to fix, and it’s worth the few minutes it takes.</p>
<h3>Update your browser</h3>
<p>If you notice that you have a lot of internet problems and you see a few problems appear, check to make sure your internet browser is up to date. Your browser is probably set to update automatically as new versions become available, but if you stop updating or skip updates, you can get caught by going to Windows Update for Internet Explorer, and by going to the Firefox Toolbar. and Chrome.</p>
<h3>Update plug-in</h3>
<p>If your browser is completely up-to-date, check to make sure your most used plugins are up to date. Among the standard plug-in for websites are things like ActiveX and Flash. You can see the message on the website to update the plug-in or you can update this yourself by visiting the websites and downloading malicious applications to update or install the plug-ins. Firefox provides a plug-in test page here too for ideas on what might be causing the problem.</p>
<p>The post <a href="https://jharaphula.com/how-to-understand-and-fix-html-errors/">How to understand and Fix HTML Errors 404 or 401 or 403?</a> appeared first on <a href="https://jharaphula.com">OneStop Shop</a>.</p>
]]></content:encoded>
					
		
		
			<media:content url="https://jharaphula.com/wp-content/uploads/2024/06/error-page.jpg" medium="image" />
	</item>
		<item>
		<title>HTML5 Canvas Examples to draw Circle, Rectangle, Line, Text &#038; Image</title>
		<link>https://jharaphula.com/html5-canvas-examples/</link>
					<comments>https://jharaphula.com/html5-canvas-examples/#respond</comments>
		
		<dc:creator><![CDATA[Biswabhusan Panda]]></dc:creator>
		<pubDate>Sun, 13 Nov 2016 13:31:17 +0000</pubDate>
				<category><![CDATA[Learn HTML5 with Examples]]></category>
		<category><![CDATA[Examples to draw Circle]]></category>
		<category><![CDATA[HTML elements]]></category>
		<category><![CDATA[HTML5 Canvas]]></category>
		<category><![CDATA[HTML5 Canvas Examples]]></category>
		<category><![CDATA[List of HTML5 new Tags]]></category>
		<guid isPermaLink="false">http://jharaphula.com/?p=6737</guid>

					<description><![CDATA[<img width="300" height="182" src="https://jharaphula.com/wp-content/uploads/2016/11/html5-canvas-300x182.png" class="webfeedsFeaturedVisual wp-post-image" alt="HTML5 Canvas Examples to draw Circle, Rectangle, Line, Text &amp; Image" style="display: block; margin-bottom: 10px; clear: both; max-width: 100%;" decoding="async" srcset="https://jharaphula.com/wp-content/uploads/2016/11/html5-canvas-300x182.png 300w, https://jharaphula.com/wp-content/uploads/2016/11/html5-canvas.png 750w" sizes="(max-width: 300px) 100vw, 300px" /><p>You must remember in the early age of HTML to draw graphics in a Web page generally we use GIF images or Flash animations. Here...</p>
<p>The post <a href="https://jharaphula.com/html5-canvas-examples/">HTML5 Canvas Examples to draw Circle, Rectangle, Line, Text &#038; Image</a> appeared first on <a href="https://jharaphula.com">OneStop Shop</a>.</p>
]]></description>
										<content:encoded><![CDATA[<img width="300" height="182" src="https://jharaphula.com/wp-content/uploads/2016/11/html5-canvas-300x182.png" class="webfeedsFeaturedVisual wp-post-image" alt="HTML5 Canvas Examples to draw Circle, Rectangle, Line, Text &amp; Image" style="display: block; margin-bottom: 10px; clear: both; max-width: 100%;" decoding="async" loading="lazy" srcset="https://jharaphula.com/wp-content/uploads/2016/11/html5-canvas-300x182.png 300w, https://jharaphula.com/wp-content/uploads/2016/11/html5-canvas.png 750w" sizes="auto, (max-width: 300px) 100vw, 300px" /><p>You must remember in the early age of HTML to draw graphics in a Web page generally we use GIF images or Flash animations. Here the major drawback is image based animations are not at all <a href="https://jharaphula.com/category/free-seo-training-tools/" rel="noopener noreferrer" target="_blank">SEO</a> friendly. Search engine are unknown about the anatomy of the animation. Looking into this the 5th generation of HTML introduced Canvas. Canvas is a rectangular area in a HTML page. Which we can define using two dimensions X &amp; Y. By default a Canvas is not having any border or content. To draw graphics using a Canvas we required the help of Scripting language. By own Canvas is acts like a Container. Look at the below HTML5 Canvas Examples to know how draw shapes over a Canvas.</p>
<h2>Canvas vs. SVG: Key Differences</h2>
<p>While both Canvas and SVG enable graphics rendering in the browser, they differ in several ways:</p>
<p><strong>Rendering Method</strong>: &#8211; Canvas is raster-based, meaning it draws pixel-by-pixel. &#8211; SVG is vector-based, using mathematical descriptions of shapes.</p>
<p><strong>DOM Interaction</strong>: &#8211; Canvas does not retain individual objects; once drawn, shapes cannot be modified unless redrawn. &#8211; SVG elements are part of the DOM, allowing for direct manipulation via CSS or JavaScript.</p>
<p><strong>Performance</strong>: &#8211; Canvas performs better for large numbers of objects and complex animations. &#8211; SVG is better suited for static or interactive vector graphics that require scalability.</p>
<p>Using a Canvas we can draw graphics like lines, boxes, circles, rectangles, squares, polygons, tingles, texts or even can add images. All the latest browsers (Google Chrome 4.0 or above, IE 9.0 or above, Mozilla Firefox 2.0 or above, Safari 3.1 or above and Opera 9.0 or above) supports Canvas. Canvas is rich for high end graphics. Starting from an animation to develop a game Canvas is awesome. While SVG gives better results for Text rendering Canvas gives better results for Graphics.</p>
<p>The following Syntax we use to define a HTML5 Canvas.</p>
<pre class="brush: xml; title: ; notranslate">&lt;canvas id=&quot;mycanvas&quot; width=&quot;300&quot; height=&quot;250&quot;&gt;
Your browser does not support HTML5 Canvas.
&lt;/canvas&gt;</pre>
<p>Keep remember while defining a Canvas always assign an ID to your Canvas. ID helps to detect the Canvas during client Scripting. You can dynamically provide width and height to a Canvas but it is advisable to define width and height during you declare a Canvas. Going forward if required you can update this settings.</p>
<p>With the above introduction let us watch some real-time examples about how to draw various shapes on over a Canvas using Scripting language. Here in the below demo I am using the popular client scripting language JavaScript. In a HTML5 Canvas you are free to any scripting language.</p>
<h3>Example to draw a Line over Canvas?</h3>
<p>Look at the below Code. Here I am drawing a straight line using JavaScript over a Canvas. The logic I implemented here is so simple. Using getElementById I am detecting the Canvas control from my HTML page. Then defining dimensions using getContext() method. Then to define coordinates for the line using moveTo I am setting the line pointer to 0, 0 coordinate. Then for the end points using lineTo() method. Keep remember the lineTo() method is useful to draw lines. At last I am applying stroke to the line using stroke() method.</p>
<pre class="brush: jscript; title: ; notranslate">var d = document.getElementById(&quot;demoCanvas&quot;);
var dln = d.getContext(&quot;2d&quot;);
dln.moveTo(0,0);
dln.lineTo(200,100);
dln.stroke();</pre>
<h3>Example to draw a Rectangle over Canvas?</h3>
<p>As we discussed above we can draw graphics on canvas using client scripts (JavaScript or Jquery). In the below example I used JavaScript to draw a rectangle. Here &#8220;mycanvas&#8221; is the id of HTML5 Canvas control. Using document object model (DOM) getElementById() method I am fetching the canvas control to my JavaScript code. Then using getContext(&#8216;2d&#8217;) I am instructing my Canvas to draw 2D Graphs. To create a rectangle I used fillRect() method. Which <strong>accepts 4 parameters as x1, y1 &amp; x2, y2 as the rectangle areas</strong>. To fill color to my Rectangle I am using fillStyle() method.</p>
<pre class="brush: jscript; title: ; notranslate">var mycanvas = document.getElementById('mycanvas');
var context = mycanvas.getContext('2d');
context.fillStyle = 'blue';
context.fillRect(20, 20, 80, 80);</pre>
<h3>Example to draw a Circle over Canvas?</h3>
<p>Similarly like a line to draw a Circle I am using arc() method. Arc() method accepts 6 parameters as x, y, radius, Starting Angle, Ending Angle &amp; Counter Clockwise or Anti-Clockwise. Look at the example below how I did draw a Circle.</p>
<pre class="brush: jscript; title: ; notranslate">var d = document.getElementById(&quot;demoCanvas&quot;);
var dln = d.getContext(&quot;2d&quot;);
dln.beginPath();
dln.arc(95,50,40,0,2*Math.PI);
dln.stroke();</pre>
<h3>Example to draw a Text over Canvas?</h3>
<p>To draw a text over Canvas generally we use FillText() method. FillText() accepts 3 parameters. First is the String which one you want to Draw as graphics. 2nd and 3rd parameters are the starting position of the text using X and Y coordinates. Additionally to define font size or font family we use font() method.<br />
var d = document.getElementById(&#8220;demoCanvas&#8221;);</p>
<pre class="brush: jscript; title: ; notranslate">var dln = d.getContext(&quot;2d&quot;);
dln.font = &quot;30px Arial&quot;;
dln.fillText(&quot;Hello World&quot;,10,50);</pre>
<h3>Example to draw Image over Canvas?</h3>
<p>Keep remember you can’t directly insert an image to the Canvas. To display an image over a Canvas you have to Draw that image. To draw an image over a Canvas drawImage() method works. Like fillText() DrawImage() also accepts 3 parameters. First parameter is the image File path. 2nd &amp; 3rd parameters are the starting point defined using X &amp; Y Coordinates.</p>
<pre class="brush: jscript; title: ; notranslate">var d = document.getElementById(&quot;demoCanvas&quot;);
var dln = d.getContext(&quot;2d&quot;);
var img = document.getElementById(&quot;imgTag”);
dln.drawImage(img,10,10);</pre>
<h2>Conclusion</h2>
<p>HTML5 Canvas is a versatile tool for creating dynamic graphics and animations on the web. Unlike SVG, it operates at the pixel level, making it ideal for performance-intensive applications. By mastering basic drawing techniques and animation principles, developers can build engaging visual experiences for users. Whether for games, data visualization, or interactive art, Canvas provides the flexibility needed to bring creative ideas to life.</p>
<p>The post <a href="https://jharaphula.com/html5-canvas-examples/">HTML5 Canvas Examples to draw Circle, Rectangle, Line, Text &#038; Image</a> appeared first on <a href="https://jharaphula.com">OneStop Shop</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://jharaphula.com/html5-canvas-examples/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			<media:content url="https://jharaphula.com/wp-content/uploads/2016/11/html5-canvas.png" medium="image" />
	</item>
		<item>
		<title>Online free HTML Tutorial for beginners &#8211; Learn Web Design</title>
		<link>https://jharaphula.com/html-tutorial-for-beginners-learn-web-design/</link>
					<comments>https://jharaphula.com/html-tutorial-for-beginners-learn-web-design/#respond</comments>
		
		<dc:creator><![CDATA[Nibedita Panda]]></dc:creator>
		<pubDate>Mon, 20 Jun 2016 11:29:58 +0000</pubDate>
				<category><![CDATA[Learn HTML5 with Examples]]></category>
		<category><![CDATA[Free HTML Tutorial]]></category>
		<category><![CDATA[HTML elements]]></category>
		<category><![CDATA[HTML Tutorial for beginners]]></category>
		<category><![CDATA[Learn Web Design]]></category>
		<category><![CDATA[Responsive Web Design]]></category>
		<category><![CDATA[W3C-Validator]]></category>
		<guid isPermaLink="false">http://jharaphula.com/?p=3877</guid>

					<description><![CDATA[<img width="300" height="184" src="https://jharaphula.com/wp-content/uploads/2016/06/html-baiscs-300x184.jpg" class="webfeedsFeaturedVisual wp-post-image" alt="Online free HTML Tutorial for beginners - Learn Web Design" style="display: block; margin-bottom: 10px; clear: both; max-width: 100%;" decoding="async" loading="lazy" srcset="https://jharaphula.com/wp-content/uploads/2016/06/html-baiscs-300x184.jpg 300w, https://jharaphula.com/wp-content/uploads/2016/06/html-baiscs.jpg 750w" sizes="auto, (max-width: 300px) 100vw, 300px" /><p>Welcome to the World of Web. HTML Stands as the Skeleton of Web Design. Complete name of HTML is &#8220;Hypertext Markup Language&#8221;. Compare to a...</p>
<p>The post <a href="https://jharaphula.com/html-tutorial-for-beginners-learn-web-design/">Online free HTML Tutorial for beginners &#8211; Learn Web Design</a> appeared first on <a href="https://jharaphula.com">OneStop Shop</a>.</p>
]]></description>
										<content:encoded><![CDATA[<img width="300" height="184" src="https://jharaphula.com/wp-content/uploads/2016/06/html-baiscs-300x184.jpg" class="webfeedsFeaturedVisual wp-post-image" alt="Online free HTML Tutorial for beginners - Learn Web Design" style="display: block; margin-bottom: 10px; clear: both; max-width: 100%;" decoding="async" loading="lazy" srcset="https://jharaphula.com/wp-content/uploads/2016/06/html-baiscs-300x184.jpg 300w, https://jharaphula.com/wp-content/uploads/2016/06/html-baiscs.jpg 750w" sizes="auto, (max-width: 300px) 100vw, 300px" /><p>Welcome to the World of Web. HTML Stands as the Skeleton of <a href="https://jharaphula.com/basics-of-web-design-beginners/" target="_blank" rel="noopener noreferrer">Web Design</a>. Complete name of HTML is &#8220;Hypertext Markup Language&#8221;. Compare to a programming language C or C++ markup languages are easy and fun to learn. A programming language comes with Data Types, Loops, Conditional Statements or Object Oriented Programming features. While a markup language only required tags and its attributes to learn. To make your journey easier here we are presenting HTML tutorial for beginners.</p>
<p>The initial version of HTML was introduced on the year of 1993 by W3C (<em>World Wide Web Consortium</em>) &amp; WHATWG (Web Hypertext Application Technology Working Group). HTML is the standard markup language to Create web pages. HTML is also used to Create user interface for Mobile applications. To Getting Started with HTML you required any text editor like Notepad or Notepad++.</p>
<h3>Structure of a HTML page</h3>
<p>Basic Structure of a HTML page is similar to a Human body. Top of the page comes with head. Then body and the end part is called footer. Look at the example below.</p>
<pre class="brush: xml; title: ; notranslate">&lt;!DOCTYPE html&gt;
&lt;html&gt;
&lt;head&gt;
&lt;title&gt;HTML Tutorial for beginners&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;h2&gt;Add Topic Heading here&lt;/h2&gt;
&lt;p&gt;Hello World!&lt;/p&gt;
&lt;/body&gt;
&lt;/html&gt;</pre>
<p>Here &lt;!DOCTYPE html&gt; is used to make the browser aware about that this is a HTML5 web page. Inside head tag I added title tag. Title tag is responsible to display which for this page is. Like title tag we can use meta tag under head tag. Meta speaks details of a web page. Generally there are various types of meta tags available in HTML but Commonly we use keywords, description or language meta tags. Body is the part where we do develop user interface. In the above example here inside my body tag I have heading tag and a paragraph tag.</p>
<h3>Basic Rules to Develop a HTML page</h3>
<p><strong>1</strong>. In Client Browser to identify the page that this is a HTML5 document you required to declare &lt;!DOCTYPE html&gt; at the top of the page. This must be your first line while creating a HTML5 web page.</p>
<p><strong>2</strong>. Title says about the headline of a story. Always make practice to add title tag in the head section of a <a href="https://jharaphula.com/category/programming-solutions/html5-examples/" target="_blank" rel="noopener noreferrer">HTML5</a> page. Title tag helps in Search Engine Optimization (SEO).</p>
<p><strong>3</strong>. There are various meta tags. Few common used meta tags are Keyword and Description. Before deploy your application to production server make a habit to add keywords &amp; description for page. Keep remember your description must not more than 160 words. Keywords can be comma separated strings. For better performace it is always wise to add not more than 5 to 6 keywords. Provide Character encoding meta tag to your HTML page. Ex. &lt;meta charset=&#8221;UTF-8&#8243;&gt;.</p>
<p><strong>4</strong>. In HTML5 use the power of Semantic Elements. Structure page take less time to debug. Generally a HTML page Comes with 4 to 5 sections like Head, Body or Footer. Learn the adnvaced HTML5 Semantic elements and use them as required.</p>
<p><strong>5</strong>. HTML is not a case sensitive language. &lt;STRONG&gt; is similar as &lt;strong&gt;. But it is a good practice to use lower case letters while developing HTML.</p>
<p><strong>6</strong>. Never ever miss an end tag in HTML. It breaks hirarchy. There are two ways to end a HTML tag. For an example img tag can be end like &#8220;&lt;/img&gt;&#8221; or &#8220;/&gt;&#8221;. It is a good practice to choose &#8220;/&gt;&#8221; in place of &#8220;&lt;/img&#8221;&gt; end tag. But in the matter of a paragraph tag you must require &#8220;&lt;/p&gt;&#8221;.</p>
<p><strong>7</strong>. In a tag while defining an attribute always use lower case letters. For an Example replace &lt;div CLASS=&#8221;tabview&#8221;&gt; with &lt;div class=&#8221;tabview&#8221;&gt;.</p>
<p><strong>8</strong>. While declaring attribute value use double quotes.</p>
<p><strong>9</strong>. In production server always avoid in-line CSS. For an example it’s a bad practice to develop &lt;div style=&#8221;float:left;&#8221; /&gt;. In this place you can add a class to the div and take your Styles to that Class.</p>
<p><strong>10</strong>. Keep HTML5 document extension to &#8220;.html&#8221; in place of &#8220;.htm&#8221;.</p>
<p><strong>11</strong>. Use language attribute with your html tag. Ex. &lt;html lang=&#8221;en-us&#8221;&gt;.</p>
<p><strong>12</strong>. For Internet Explorer Compatibility mode use &lt;meta http-equiv=&#8221;X-UA-Compatible&#8221; content=&#8221;IE=Edge&#8221;&gt;.</p>
<p><strong>13</strong>. While defining attributes to a HTML tag maintain the sequence order like class, id or name, data-*, src, type, href, for, value, title or alt, role &amp; aria-*.</p>
<p><strong>14</strong>. During you integrate CSS or JS file to your HTML5 document don’t include type=&#8221;text/css&#8221; or type=&#8221;text/javascript&#8221;. Modern browsers are too smart they can detect without the attributes.</p>
<h3>Heading Tags (H1, H2, …, H6)</h3>
<p>Generally H1 to H6 tag we used to display topic title or sub-titles of a HTML page. To instruct Search engines about your topic, heading tags are very helpful. H1 tag is more important heading tag then H6 tag. Never use heading tag to make texts bold or big.</p>
<h3>Paragraph</h3>
<p>In HTML &lt;p&gt; tag is used to define a Paragraph. Browser automatically add space to top and bottom of a paragraph. A paragraph starts with &lt;p&gt; and ends with &lt;/p&gt;.</p>
<h3>Line Break</h3>
<p>In HTML to bring a new line we use &lt;br /&gt;. While adding a new line tag use &lt;br /&gt; in place of only &lt;br&gt;.</p>
<h3>Using CSS with HTML</h3>
<p>There are 4 different ways to Apply CSS in a HTML document. These are In-line CSS, Embedded CSS, Linked CSS &amp; Imported CSS.</p>
<p><em>Example of In-line CSS</em></p>
<pre class="brush: xml; title: ; notranslate">&lt;div style=&quot;font-size: 14px; color: #FF0000;&quot;&gt;This is in Red Color&lt;/p&gt;</pre>
<p><em>Example of Embedded CSS</em></p>
<pre class="brush: css; title: ; notranslate">&lt;style type=&quot;text/css&quot;&gt;
h2 { 
font-size: 14px; 
color: #2d2d00; 
font-weight: 600; 
}
&lt;/style&gt;</pre>
<p><em>Example of Linked CSS</em></p>
<pre class="brush: xml; title: ; notranslate">&lt;link rel=&quot;stylesheet&quot; href=&quot;custom/custom.css&quot; type=&quot;text/css&quot; media=&quot;screen, projection&quot; /&gt;</pre>
<p><em>Example of Imported CSS</em></p>
<pre class="brush: xml; title: ; notranslate">@import url('/css/color.css');</pre>
<h3>HTML Text Formatting Tags</h3>
<p><span style="color:brown;">&lt;strong&gt;</span> &#8211; Use to defines bold or important labels.<br />
<span style="color:brown;">&lt;em&gt;</span> &#8211; Defines emphasized text.<br />
<span style="color:brown;">&lt;i&gt;</span> &#8211; Defines italic text.<br />
<span style="color:brown;">&lt;sub&gt;</span> &#8211; Defines subscripted text.<br />
<span style="color:brown;">&lt;sup&gt;</span> &#8211; Defines superscripted text.<br />
<span style="color:brown;">&lt;ins&gt;</span> &#8211; This tag we use to insert text in to a pre-defined paragraph.<br />
<span style="color:brown;">&lt;del&gt;</span> &#8211; Del is used to delete text from a pre-defiend paragraph.</p>
<h3>How to Comment in HTML?</h3>
<p>The following Syntax we use to Comment in HTML.<br />
&lt;!&#8211; Your Comments goes here &#8211;&gt;</p>
<h3>HTML Link</h3>
<p>In HTML we use anchor tag to place a link. A link helps to redirect user from one page to other HTML page. Syntax to Create a link is as below.</p>
<pre class="brush: xml; title: ; notranslate">&lt;a href=&quot;http://www.example.com&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;Link text goes here&lt;/a&gt;</pre>
<p>While Creating a link using target=&#8221;_blank&#8221; we can instruct the browser to open that link in a new window.</p>
<h3>HTML Image</h3>
<p>While designing a web page image plays great role. In HTML we use &lt;img&gt; tag to place images. Image tag supports all types of images such as jpeg, png or gif. The following syntax we use to add an image using image tag.</p>
<pre class="brush: xml; title: ; notranslate">&lt;img src=&quot;http://example.com/logo.png&quot; alt=&quot;Logo&quot; title=&quot;Logo&quot; /&gt;</pre>
<p>In image tag src attribute helps to define the image path. Image path can be absolute or an url too. For better performance in image tag it is a good practice to use alt and title attributes. These attributes give defination to an image.</p>
<h3>HTML Table</h3>
<p>In a web page generally we use table to display data in a structural way. A table comes with rows and columns. In HTML to create a table we use the following syntax.</p>
<pre class="brush: xml; title: ; notranslate">&lt;table&gt;
&lt;td&gt;
&lt;tr&gt;First Row of First Column&lt;/tr&gt;
&lt;tr&gt;Second Row of First Column&lt;/tr&gt;
&lt;tr&gt;Third Row of First Column&lt;/tr&gt;
&lt;/td&gt;
&lt;td&gt;
&lt;tr&gt;First Row of Second Column &lt;/tr&gt;
&lt;tr&gt;Second Row of Second Column &lt;/tr&gt;
&lt;tr&gt;Third Row of Second Column&lt;/tr&gt;
&lt;/td&gt;
&lt;/table&gt;</pre>
<p>The above table is with 2 columns and 3 rows.</p>
<h3>Frequently used of HTML Tags</h3>
<p>Compare to older versions of HTML, HTML5 is rich with many new features. To design a web page more better HTML5 is enrich with advanced Structural Elements &amp; Form elements. Some of them are as below.</p>
<p><span style="color:brown;">&lt;header&gt;</span> – While Designing a HTML file header tag helps to define page header in a separate block.</p>
<p><span style="color:brown;">&lt;main&gt;</span> – In a HTML document main is the area in between header &amp; footer. Main tag in HTML5 helps to design better structure of a HTML document.</p>
<p><span style="color:brown;">&lt;footer&gt;</span> – In a web page HTML footer tag helps to define page footer in a separate block.</p>
<p><span style="color:brown;">&lt;nav&gt;</span> – Nav element in HTML5 helps to define navigation links under a single tab.</p>
<p><span style="color:brown;">&lt;progress&gt;</span> – Progress tab act like an indication. If some job running in background using this control we can show how much work is in progress.</p>
<p><span style="color:brown;">&lt;mark&gt;</span> – Mark tag in HTML5 helps to Highlight text easily.</p>
<p><span style="color:brown;">&lt;meter&gt;</span> – Meter tag in HTML5 help to present scalar measurement within a known range.</p>
<p><span style="color:brown;">&lt;dialog&gt;</span> – Using dialog tag we can show popup like window in HTML5. Dialog tag supports Chrome version 37+, Safari 6+ &amp; Opera 24+.</p>
<p><span style="color:brown;">&lt;article&gt;</span> – article tag defines an Article in the document. Using article tag we can categorized content area in a HTML file. </p>
<p><span style="color:brown;">&lt;aside&gt;</span> – aside tag defines content aside from body content.</p>
<p><span style="color:brown;">&lt;bdi&gt;</span> – bdi tag helps to identify text that might be formatted in a different direction from normal text.</p>
<p><span style="color:brown;">&lt;time&gt;</span> – time tag helps to specify date &amp; time part in a HTML file.</p>
<p><span style="color:brown;">&lt;section&gt;</span> – To identify a particular section in a HTML document section tag is useful.</p>
<p><span style="color:brown;">&lt;wbr&gt;</span> – Defines a possible line-break.</p>
<p><span style="color:brown;">&lt;audio&gt;</span> – Using audio tag in HTML5 we can define music.</p>
<p><span style="color:brown;">&lt;video&gt;</span> – Using video tag in HTML5 we can define movie.</p>
<p><span style="color:brown;">&lt;embed&gt;</span> – embed tag act like a plugin. Using embed tag we can integrate external application to HTML5 document.</p>
<p><span style="color:brown;">&lt;source&gt;</span> – source tag helps to declare file path for audio or video elements.</p>
<p><span style="color:brown;">&lt;track&gt;</span> – Defines tracks for video &amp; audio.</p>
<p><span style="color:brown;">&lt;canvas&gt;</span> – Canvas is a new HTML5 element to draw Graphics using Client Script. Read more about HTML5 Canvas.</p>
<p><span style="color:brown;">&lt;svg&gt;</span> – HTML5 Supports SVG. svg tag helps to draw graphics using SVG.</p>
<p>Do you like this Story about HTML Tutorial for beginners? Share us.</p>
<p>The post <a href="https://jharaphula.com/html-tutorial-for-beginners-learn-web-design/">Online free HTML Tutorial for beginners &#8211; Learn Web Design</a> appeared first on <a href="https://jharaphula.com">OneStop Shop</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://jharaphula.com/html-tutorial-for-beginners-learn-web-design/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			<media:content url="https://jharaphula.com/wp-content/uploads/2016/06/html-baiscs.jpg" medium="image" />
	</item>
		<item>
		<title>HTML5 Coding Standards and Best Practices for Web Design</title>
		<link>https://jharaphula.com/html5-coding-standards-best-practices/</link>
					<comments>https://jharaphula.com/html5-coding-standards-best-practices/#respond</comments>
		
		<dc:creator><![CDATA[Nibedita Panda]]></dc:creator>
		<pubDate>Sun, 15 May 2016 17:06:00 +0000</pubDate>
				<category><![CDATA[Learn HTML5 with Examples]]></category>
		<category><![CDATA[Best Practices]]></category>
		<category><![CDATA[HTML5 Coding Standards]]></category>
		<category><![CDATA[Introduction to HTML5]]></category>
		<category><![CDATA[Web Design best practices]]></category>
		<category><![CDATA[Web Designing]]></category>
		<guid isPermaLink="false">http://box.jharaphula.com/?p=1639</guid>

					<description><![CDATA[<img width="300" height="178" src="https://jharaphula.com/wp-content/uploads/2016/05/html5-style-guide-300x178.jpg" class="webfeedsFeaturedVisual wp-post-image" alt="HTML5 Coding Standards &amp; Best Practices for Web Design" style="display: block; margin-bottom: 10px; clear: both; max-width: 100%;" decoding="async" loading="lazy" srcset="https://jharaphula.com/wp-content/uploads/2016/05/html5-style-guide-300x178.jpg 300w, https://jharaphula.com/wp-content/uploads/2016/05/html5-style-guide.jpg 750w" sizes="auto, (max-width: 300px) 100vw, 300px" /><p>Designing a Software is not a Single handed job. Multiple resources required to build an application. Let&#8217;s assume in your lab 5 peoples are working...</p>
<p>The post <a href="https://jharaphula.com/html5-coding-standards-best-practices/">HTML5 Coding Standards and Best Practices for Web Design</a> appeared first on <a href="https://jharaphula.com">OneStop Shop</a>.</p>
]]></description>
										<content:encoded><![CDATA[<img width="300" height="178" src="https://jharaphula.com/wp-content/uploads/2016/05/html5-style-guide-300x178.jpg" class="webfeedsFeaturedVisual wp-post-image" alt="HTML5 Coding Standards &amp; Best Practices for Web Design" style="display: block; margin-bottom: 10px; clear: both; max-width: 100%;" decoding="async" loading="lazy" srcset="https://jharaphula.com/wp-content/uploads/2016/05/html5-style-guide-300x178.jpg 300w, https://jharaphula.com/wp-content/uploads/2016/05/html5-style-guide.jpg 750w" sizes="auto, (max-width: 300px) 100vw, 300px" /><p>Designing a Software is not a Single handed job. Multiple resources required to build an application. Let&#8217;s assume in your lab 5 peoples are working with you as a Team. Here if your Coding Standards are different from others then practically it is difficult to understood by an another developer. Unplanned Coding Standards waste quality time of a Developer. How it is if we all will maintain similar Coding Standards? This habit makes our job easier. As you know in Software industry Code is the major asset. It has no depreciation. In each revision it shines better. Developers are responsible to generate Codes. Codes are like the Skeleton of an Application. What we invest while designing a Software the major percentage is to develop Codes only. It&#8217;s better if before into development your developer team aware about the value of Codes. Looking into these factors here with we are sharing universal HTML5 Coding Standards for web designers.</p>
<p><strong>1</strong>. There are many version of HTML. Using &lt;!doctype html&gt; at the top of a HTML File, Client Browser will understood that the web is designed with HTML5. In a HTML5 document always declare this as the First Line.</p>
<p><strong>2</strong>. While Creating a HTML page never miss the title tag. It <a href="https://jharaphula.com/category/free-seo-training-tools/" target="_blank" rel="noopener noreferrer">helps in SEO</a>.</p>
<p><strong>3</strong>. Meta information&#8217;s are useful for Search Engines to track your HTML page. Make a habit to define minimum 2 meta tags in your HTML page. Those are Keywords and Description. If your HTML page is responsive then additionally define meta viewport tag.</p>
<p><strong>4</strong>. Use advanced programmer friendly IDE to develop Codes. For an example you can install &#8220;MS Visual Studio&#8221;.</p>
<p><strong>5</strong>. While generating html in HTML5 use the power of Semantic Elements. For an example if in your HTML5 page there are three sections header, container and footer define them inside Semantic Elements. In a large HTML page Semantic Elements helps to maintain hierarchy.</p>
<p><strong>6</strong>. HTML is not case sensitive. If you are using &lt;STRONG&gt; tag in place of &lt;strong&gt; it will not affect anything but refer to early age it&#8217;s a good practice to write HTML in lower case letters.</p>
<p><strong>7</strong>. Generally in-case of Freshers it was noticed they forgot the end tag. Always make practice if you are defining a tag there must be a end tag. For an example if you are using image tag then there are two ways to close this tag. You can go for &lt;/img&gt; or /&gt; at the end. It is a best practice to choose /&gt; in place of img end tag. But in the matter of a paragraph tag you must required &lt;/p&gt;.</p>
<p><strong>8</strong>. Inside a Tag while defining an attribute use lower case letters. Ex. Replace &lt;div CLASS=&#8221;tab&#8221;&gt; with &lt;div class=&#8221;tab&#8221;&gt;.</p>
<p><strong>9</strong>. Define an attribute value in side double quotes. For an example while defined the source path (src) of an image tag you required to write like &lt;img src=&#8221;/images/temp.jpg&#8221;. Do same for multiple attribute values. For an example in a div I am with 2 CSS classes &lt;div class=&#8221;menu dashboard&#8221;.</p>
<p><strong>10</strong>. Make a habit to Comment your Codes professionally. I noticed many developers Comments on Unnecessary places. Comment only if you found the block of Code is difficult to understood by you Colleague.</p>
<p><strong>11</strong>. CSS helps to Style HTML. In production avoid in-line CSS. For an example it is a wrong practice to write like &lt;div style=&#8221;float:left;&#8221; /&gt; replace this with &lt;div class=&#8221;leftAlign&#8221; /&gt;. Here leftAlign the class which contains float:left;.</p>
<p><strong>12</strong>. Use lower Case letters while creating a File name. Update the HTML5 page extension to .html in place of .htm.</p>
<p><strong>13</strong>. Nested <a href="https://jharaphula.com/list-of-html5-new-tags/" target="_blank" rel="noopener noreferrer">HTML elements</a> should be indented once (two spaces).</p>
<p><strong>14</strong>. Use language attribute with your html tag. Ex. &lt;html lang=&#8221;en-us&#8221;&gt;.</p>
<p><strong>15</strong>. For IE Compatibility mode use &lt;meta http-equiv=&#8221;X-UA-Compatible&#8221; content=&#8221;IE=Edge&#8221;&gt;.</p>
<p><strong>16</strong>. Provide Character encoding meta tag to your HTML page. Ex. &lt;meta charset=&#8221;UTF-8&#8243;&gt;.</p>
<p><strong>17</strong>. While embedding CSS or JS file to your HTML document don’t include type=”text/css” or type=”text/javascript”. Modern browsers are too smart they will take care of script type.</p>
<p>Ex.</p>
<pre class="brush: css; title: ; notranslate">&lt;!– Code Embed External CSS –&gt;
&lt;link rel=”stylesheet” href=”code-guide.css”&gt;

&lt;!– In-line CSS –&gt;
&lt;style&gt;/* … */&lt;/style&gt;

&lt;!– Code to Embed External JS –&gt;
&lt;script src=”code-guide.js”&gt;&lt;/script&gt;</pre>
<p><strong>18</strong>.  While defining attributes to a HTML tag maintain the sequence order like class, id or name, data-*, src, type, href, for, value, title or alt, role &amp; aria-*.</p>
<p><strong>19</strong>. Whenever it is possible try to reduce superfluous parent elements.</p>
<p>Do you like the above Article related to HTML5 Coding Standards? While Coding HTML Follow this Guidelines.</p>
<p>The post <a href="https://jharaphula.com/html5-coding-standards-best-practices/">HTML5 Coding Standards and Best Practices for Web Design</a> appeared first on <a href="https://jharaphula.com">OneStop Shop</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://jharaphula.com/html5-coding-standards-best-practices/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			<media:content url="https://jharaphula.com/wp-content/uploads/2016/05/html5-style-guide.jpg" medium="image" />
	</item>
		<item>
		<title>How to Store, Retrieve &#038; Delete data from HTML5 IndexedDB?</title>
		<link>https://jharaphula.com/store-retrieve-delete-html5-indexeddb/</link>
					<comments>https://jharaphula.com/store-retrieve-delete-html5-indexeddb/#respond</comments>
		
		<dc:creator><![CDATA[Nibedita Panda]]></dc:creator>
		<pubDate>Sun, 15 May 2016 16:32:38 +0000</pubDate>
				<category><![CDATA[Learn HTML5 with Examples]]></category>
		<category><![CDATA[Datalist in HTML5]]></category>
		<category><![CDATA[Delete data from IndexedDB]]></category>
		<category><![CDATA[HTML elements]]></category>
		<category><![CDATA[HTML5 IndexedDB]]></category>
		<category><![CDATA[Web SQL vs IndexedDB]]></category>
		<guid isPermaLink="false">http://box.jharaphula.com/?p=1612</guid>

					<description><![CDATA[<img width="300" height="188" src="https://jharaphula.com/wp-content/uploads/2016/05/html5-indexdb-300x188.jpg" class="webfeedsFeaturedVisual wp-post-image" alt="How to Store, Retrieve &amp; Delete data from HTML5 IndexedDB?" style="display: block; margin-bottom: 10px; clear: both; max-width: 100%;" decoding="async" loading="lazy" srcset="https://jharaphula.com/wp-content/uploads/2016/05/html5-indexdb-300x188.jpg 300w, https://jharaphula.com/wp-content/uploads/2016/05/html5-indexdb.jpg 750w" sizes="auto, (max-width: 300px) 100vw, 300px" /><p>World is running under Client Server architecture. In real-time Customer interacts to Server through Clients. Server stores data. Depending upon the level of authentication and...</p>
<p>The post <a href="https://jharaphula.com/store-retrieve-delete-html5-indexeddb/">How to Store, Retrieve &#038; Delete data from HTML5 IndexedDB?</a> appeared first on <a href="https://jharaphula.com">OneStop Shop</a>.</p>
]]></description>
										<content:encoded><![CDATA[<img width="300" height="188" src="https://jharaphula.com/wp-content/uploads/2016/05/html5-indexdb-300x188.jpg" class="webfeedsFeaturedVisual wp-post-image" alt="How to Store, Retrieve &amp; Delete data from HTML5 IndexedDB?" style="display: block; margin-bottom: 10px; clear: both; max-width: 100%;" decoding="async" loading="lazy" srcset="https://jharaphula.com/wp-content/uploads/2016/05/html5-indexdb-300x188.jpg 300w, https://jharaphula.com/wp-content/uploads/2016/05/html5-indexdb.jpg 750w" sizes="auto, (max-width: 300px) 100vw, 300px" /><p>World is running under Client Server architecture. In real-time <strong>Customer interacts to Server through Clients</strong>. Server stores data. Depending upon the level of authentication and type of request Server provides data to Clients. As a common practice <strong>in this response request mechanism generally we use Database to store large amount of data</strong>. Which resides in Server. During http requests if the page contains data from the Database then it takes time to load. Which directly affects performance. How it is if we can operate large amount of data in Client machine? I can say definitely <a href="https://jharaphula.com/best-practices-website-speed-performance/" target="_blank" rel="noopener noreferrer">it will improve the performance</a>.</p>
<p>IndexedDB is a new feature introduced in the 5th revision of HTML. Using IndexedDB we can store large amount of data to the Client Browser. <strong>Compare to a Cookie IndexedDB works faster and stores bigger</strong>. IndexedDB stores data in KEY &amp; VALUE pair. The term has derived from Database. That&#8217;s why by hearing the term &#8220;IndexedDB&#8221; many of us guess SQL. <strong>No it is not like SQL</strong>. IndexedDB doesn&#8217;t support any kind of <a href="https://jharaphula.com/sql-queries-with-example/" rel="noopener noreferrer" target="_blank">SQL query</a>. IndexedDB runs under Single domain only.</p>
<h2>Key Concepts of IndexedDB</h2>
<p><strong>1. Databases</strong></p>
<p>IndexedDB operates on a per-origin basis, meaning each website or application has its own database. A single origin can have multiple databases, each identified by a unique name.</p>
<p><strong>2. Object Stores</strong></p>
<p>An object store is the primary storage mechanism in IndexedDB, similar to tables in relational databases. Each object store contains a collection of key-value pairs where the key must be unique.</p>
<p><strong>3. Indexes</strong></p>
<p>Indexes allow for efficient querying of data within an object store. They enable developers to retrieve records based on properties other than the primary key.</p>
<p><strong>4. Transactions</strong></p>
<p>Transactions ensure that database operations are performed reliably. A transaction can include multiple read and write operations, and if any operation fails, the entire transaction is rolled back.</p>
<p><strong>5. Cursors</strong></p>
<p>Cursors provide a way to iterate over records in an object store or index, enabling efficient traversal of large datasets.</p>
<h3>Getting Started with HTML5 IndexedDB</h3>
<p>To implement IndexedDB in a HTML5 page initially you required to declare the following js scripts.</p>
<pre class="brush: jscript; title: ; notranslate">window.indexedDB = window.indexedDB || window.mozIndexedDB || window.webkitIndexedDB || window.msIndexedDB;
 
window.IDBTransaction = window.IDBTransaction || window.webkitIDBTransaction || window.msIDBTransaction;
window.IDBKeyRange = window.IDBKeyRange || window.webkitIDBKeyRange || window.msIDBKeyRange
 
if (!window.indexedDB) {
window.alert(&quot;Update your browser. Older version is incompatible for IndexedDB.&quot;)
}</pre>
<h3>Prepare Data for IndexedDB</h3>
<p>Before we jump to Create a Database first let us keep some data ready. In below I am presenting few records from my &#8220;Employee_Details&#8221; table. Keep mark the Data Structure I presented below is in JSON form.</p>
<pre class="brush: jscript; title: ; notranslate">const employeeDetails = [
{ emp_id: &quot;01&quot;, name: &quot;Raghav Sukla&quot;, dob: &quot;01/06/1980&quot;, email_id: &quot;raghav@gmail.com&quot; },
{ emp_id: &quot;02&quot;, name: &quot;Hariharan Swain&quot;, dob: &quot;13/11/1972&quot;, email_id: &quot;hariharan@gmail.com&quot; }
{ emp_id: &quot;03&quot;, name: &quot;Satyabrata Panda&quot;, dob: &quot;22/06/1973&quot;, email_id: &quot;satyabrata@gmail.com&quot; }
];</pre>
<h3>Create an IndexedDB Database</h3>
<p>Like we do in SQL or any DBMS here also we required to Create a Database. Look at the below Code here I created a Database. The method I used is &#8220;window.indexedDB.open(&#8220;&lt;Your Database Name&gt;&#8221;). Under Database I handing 3 events onerror for error handling, onsuccess for successful response and onupgradeneeded for adding record during up-gradation.</p>
<pre class="brush: jscript; title: ; notranslate">var mydb;
var request = window.indexedDB.open(&quot;demoDb&quot;, 1);
/* Handling Error */
request.onerror = function(event) {
console.log(&quot;Error Occurred.&quot;);
};
/* Executing after Success */
request.onsuccess = function(event) {
mydb = request.result;
console.log(&quot;success: &quot;+ mydb);
};
/* While Updating */
request.onupgradeneeded = function(event) {
var mydb = event.target.result;
var objectStore = mydb.createObjectStore(&quot;empDetails&quot;, {keyPath: &quot;emp_id&quot;});
            
for (var i in employeeDetails) {
objectStore.add(employeeDetails[i]);
}
}</pre>
<h3>How to Store records to HTML5 IndexedDB?</h3>
<p>Without records Database is meaningless. Let&#8217;s watch the example below. </p>
<pre class="brush: jscript; title: ; notranslate">function insertRecords() {
var request = mydb.transaction([&quot;empDetails&quot;], &quot;readwrite&quot;)
.objectStore(&quot;empDetails&quot;)
.add({ emp_id: &quot;04&quot;, name: &quot;Vratika Viswakarma&quot;, dob: &quot;02/08/1982&quot;, email_id: &quot;vratika@gmail.com&quot; });
request.onsuccess = function(event) {
alert(&quot;Vratika Viswakarma is added to your Database.&quot;);
};
request.onerror = function(event) {
alert(&quot;Getting Errors.&quot;);
}
}</pre>
<p>While adding records I am maintaining the same sequence and key value pairs.</p>
<h3>Function to Read Data from HTML5 IndexedDB</h3>
<p>You must aware of the power of a SQL SELECT Statement. Like the same look at the below code how I am fetching records from IndexedDB. Here I used &#8220;emp_id&#8221; as the WHERE Condition.</p>
<pre class="brush: jscript; title: ; notranslate">function readRecords() {
var trans = mydb.transaction([&quot;empDetails&quot;]);
var objectStore = trans.objectStore(&quot;empDetails&quot;);
var request = objectStore.get(&quot;04&quot;);
/* On Error */        
request.onerror = function(event) {
alert(&quot;Unable to Retrieve Data.&quot;);
};
/* On Success */            
request.onsuccess = function(event) {
// Here you can Operate request.result Data!
if(request.result) {
alert(&quot;Name: &quot; + request.result.name + &quot;, DOB: &quot; + request.result.dob + &quot;, Email: &quot; + request.result.email_id);
}
else {
alert(&quot;Vratika Viswakarma couldn't be found in your database!&quot;);
}
};
}</pre>
<p>In below this an another way to fetch records sequentially. You can say this trick is similar to a SQL Cursor.</p>
<pre class="brush: jscript; title: ; notranslate">function readAllRecords() {
var objectStore = mydb.transaction(&quot;empDetails&quot;).objectStore(&quot;empDetails&quot;);
objectStore.openCursor().onsuccess = function(event) {
var indexeddb_cursor = event.target.result;
if (indexeddb_cursor) {
alert(&quot;Name for id &quot; + indexeddb_cursor.key + &quot; is &quot; + indexeddb_cursor.value.name + &quot;, DOB: &quot; + indexeddb_cursor.value.dob + &quot;, Email: &quot; + indexeddb_cursor.value.email_id);
indexeddb_cursor.continue();
}
else {
alert(&quot;No more entries!&quot;);
}
};
}</pre>
<h3>How to Delete records from HTML5 IndexedDB?</h3>
<p>Delete is a very Common Operation of DBMS. In the below example we are passing &#8220;emp_id&#8221; to Delete a record.</p>
<pre class="brush: jscript; title: ; notranslate">function deleteRecords() {
var request = mydb.transaction([&quot;empDetails&quot;], &quot;readwrite&quot;)
.objectStore(&quot;empDetails&quot;)
.delete(&quot;04&quot;);
request.onsuccess = function(event) {
alert(&quot;Vratika Viswakarma record has been removed from Database.&quot;);
};
}</pre>
<h2>Best Practices</h2>
<p><strong>1. Error Handling</strong>: Always implement error handling to manage database operation failures gracefully.<br />
<strong>2. Transaction Management</strong>: Use transactions efficiently to avoid performance bottlenecks.<br />
<strong>3. Database Versioning</strong>: Handle database upgrades carefully to prevent data loss.<br />
<strong>4. Memory Management</strong>: Close database connections when not in use to free up resources.</p>
<h2>Limitations of IndexedDB</h2>
<p>Despite its advantages, IndexedDB has some limitations:</p>
<p>&#8211; Complex API: The API is more complex compared to localStorage or sessionStorage.<br />
&#8211; Browser Support Variations: While widely supported, some older browsers may have partial or inconsistent implementations.<br />
&#8211; No Built-in Synchronization: Unlike server-side databases, IndexedDB does not provide built-in synchronization mechanisms.</p>
<h2>Conclusion</h2>
<p>HTML5 IndexedDB is a powerful client-side storage solution for web applications requiring large-scale, structured data storage. Its asynchronous nature, transaction support, and indexing capabilities make it ideal for complex applications. While it has a steeper learning curve compared to simpler storage options, mastering IndexedDB enables developers to build more robust and efficient web applications. By following best practices and understanding its core concepts, developers can leverage IndexedDB to enhance user experiences with offline capabilities and fast data access.</p>
<p>The post <a href="https://jharaphula.com/store-retrieve-delete-html5-indexeddb/">How to Store, Retrieve &#038; Delete data from HTML5 IndexedDB?</a> appeared first on <a href="https://jharaphula.com">OneStop Shop</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://jharaphula.com/store-retrieve-delete-html5-indexeddb/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			<media:content url="https://jharaphula.com/wp-content/uploads/2016/05/html5-indexdb.jpg" medium="image" />
	</item>
		<item>
		<title>Using LocalStorage Objects vs Web SQL Database in HTML5</title>
		<link>https://jharaphula.com/web-storage-web-sql-in-html5/</link>
					<comments>https://jharaphula.com/web-storage-web-sql-in-html5/#respond</comments>
		
		<dc:creator><![CDATA[Nibedita Panda]]></dc:creator>
		<pubDate>Sun, 15 May 2016 14:43:48 +0000</pubDate>
				<category><![CDATA[Learn HTML5 with Examples]]></category>
		<category><![CDATA[5th revision of HTML]]></category>
		<category><![CDATA[HTML5 Examples]]></category>
		<category><![CDATA[IndexedDB in HTML5]]></category>
		<category><![CDATA[LocalStorage]]></category>
		<category><![CDATA[Web SQL vs IndexedDB]]></category>
		<category><![CDATA[Web Storage]]></category>
		<guid isPermaLink="false">http://box.jharaphula.com/?p=1551</guid>

					<description><![CDATA[<img width="300" height="182" src="https://jharaphula.com/wp-content/uploads/2016/05/web-storage-in-html5-300x182.jpg" class="webfeedsFeaturedVisual wp-post-image" alt="Web Storage (LocalStorage) vs Web SQL vs IndexedDB in HTML5" style="display: block; margin-bottom: 10px; clear: both; max-width: 100%;" decoding="async" loading="lazy" srcset="https://jharaphula.com/wp-content/uploads/2016/05/web-storage-in-html5-300x182.jpg 300w, https://jharaphula.com/wp-content/uploads/2016/05/web-storage-in-html5.jpg 750w" sizes="auto, (max-width: 300px) 100vw, 300px" /><p>In the early age of HTML5, application data was stored in cookies &#38; included in every server request. Compare to Cookies with web storage, web...</p>
<p>The post <a href="https://jharaphula.com/web-storage-web-sql-in-html5/">Using LocalStorage Objects vs Web SQL Database in HTML5</a> appeared first on <a href="https://jharaphula.com">OneStop Shop</a>.</p>
]]></description>
										<content:encoded><![CDATA[<img width="300" height="182" src="https://jharaphula.com/wp-content/uploads/2016/05/web-storage-in-html5-300x182.jpg" class="webfeedsFeaturedVisual wp-post-image" alt="Web Storage (LocalStorage) vs Web SQL vs IndexedDB in HTML5" style="display: block; margin-bottom: 10px; clear: both; max-width: 100%;" decoding="async" loading="lazy" srcset="https://jharaphula.com/wp-content/uploads/2016/05/web-storage-in-html5-300x182.jpg 300w, https://jharaphula.com/wp-content/uploads/2016/05/web-storage-in-html5.jpg 750w" sizes="auto, (max-width: 300px) 100vw, 300px" /><p>In the early age of HTML5, application data was stored in cookies &amp; included in every server request. Compare to Cookies with web storage, web applications can store data locally within the user&#8217;s browser. <a href="https://jharaphula.com/category/programming-solutions/html5-examples/" target="_blank" rel="noopener noreferrer">HTML5</a> Local storage is more secured and performance wise rich. Local Storage limit is larger than cookies &amp; information is not passed on to the server, it is per origin, i.e., per domain and per protocol.</p>
<h2>Using HTML5 LocalStorage Objects</h2>
<p>HTML 5 storage is based on named key-value pairs. The data is stored based on a named key, retrieve using the same key, and the named key will be a string.</p>
<p>HTML provides 2 objects for Web Storage:</p>
<p>1. window.localStorage: stores data without an expiration date. The local storage will be available whenever you would use that page. Local storage will be available in the browser to all windows with the same origin (domain).</p>
<p><em>Example</em>:</p>
<pre class="brush: jscript; title: ; notranslate">localStorage.setItem (&quot;firstname&quot;, &quot;John&quot;);
document.getElementById(&quot;name&quot;).innerHTML = localStorage.getItem(&quot;firstname&quot;);</pre>
<p>2. window.sessionStorage: stores data only for a session (data will be lost when the browser is closed). Multiple windows from the same origin (URL) cannot see others session storage. Using sessionStorage object is same as localStorage object, except that it stores data for only one session.</p>
<p><em>Example</em>: setItem (key, value) to save database key/value</p>
<pre class="brush: jscript; title: ; notranslate">sessionStorage.setItem(&quot;name&quot;, &quot;Picasso&quot;); /* Here name is the key, Picasso is value */
var data = sessionStorage.getItem('name');</pre>
<h2>Using Web SQL Database</h2>
<p>The Web SQL Database API is not a part of <a href="https://www.w3schools.com/html/" rel="nofollow">HTML5</a>, but is a separate specification which has a set of APIs to manipulate client side databases using SQL. It is essentially an embedded SQLite database. You can create a database, tables and run SQL on it.</p>
<p>The Web SQL Database is a relational database system that allows web applications to store structured data using SQL queries. Unlike other client-side storage options like `localStorage` or `IndexedDB`, Web SQL Database supports full SQL syntax, making it a powerful choice for applications requiring complex data operations.</p>
<h2>HTML5 Web SQL Database Methods</h2>
<p>The HTML5 Web SQL Database offers a robust solution for client-side data storage, leveraging SQL for structured data management. While its future is uncertain due to deprecation, it remains a viable option for certain applications. By mastering `openDatabase`, `transaction`, and `executeSql`, developers can build efficient offline-capable web applications. Understanding its strengths and limitations ensures informed decisions when choosing client-side storage solutions.</p>
<p>There are 3 methods in SQL database which are as follows:</p>
<ul>
<li><strong>openDatabase</strong> – This method creates a database object either of the existing database or creating a new one. The `openDatabase` method initializes a new database or opens an existing one. It takes four parameters: &#8211; Name: The database name. &#8211; Version: The database version (used for schema changes). &#8211; Description: A brief description of the database. &#8211; Size: The estimated database size in bytes. &#8211; Creation Callback (optional): A function executed if the database is created.</li>
<li><strong>transaction</strong> – This method helps to control a transaction and performing either commit or rollback as per the requirement. The `transaction` method executes a series of SQL operations within a single transaction, ensuring data integrity. If any operation fails, the entire transaction is rolled back. Parameters: &#8211; Transaction Callback: A function containing SQL operations. &#8211; Error Callback (optional): Handles transaction errors. &#8211; Success Callback (optional): Executes upon successful completion.</li>
<li><strong>executeSql</strong> – This method is used to execute the SQL query. Parameters: &#8211; SQL Query: The SQL statement to execute. &#8211; Parameters (optional): An array of values for placeholders (`?`). &#8211; Success Callback (optional): Handles query results. &#8211; Error Callback (optional): Manages query errors.</li>
</ul>
<h3>Opening Database</h3>
<p>The openDatabase method creates a database or helps in opening the existing database. To create and open a database we have to do the following:</p>
<pre class="brush: jscript; title: ; notranslate">var dbs = openDatabase('mydbs', '1.0', 'test1db', 2*1024*1024);</pre>
<p>The above method has 5 parameters – database name, version number, text description, size of database, creation callback. The creation callback parameter will be called when the database is created.</p>
<h3>Executing Queries</h3>
<p>To execute a query the database.transaction () function is used. This function needs a single argument which is a function which executes the query as follows:</p>
<pre class="brush: jscript; title: ; notranslate">dbs.transaction (function(tq)) {
tq.executeSql('CREATE TABLE IF NOT EXISTS LOGS (id unique, log)');
});</pre>
<p>The above query will create a table called LOGS in ‘mydbs’ database.</p>
<h3>INSERT Operation</h3>
<p>To create entries into the database table we add <a href="https://jharaphula.com/sql-queries-with-example/" target="_blank" rel="noopener noreferrer">SQL queries</a> as below:</p>
<pre class="brush: jscript; title: ; notranslate">var dbs = openDatabase('mydbs', '1.0', 'test1db', 2*1024*1024);
dbs.transaction (function(tq)) {
tq.executeSql('CREATE TABLE IF NOT EXISTS LOGS (id unique, log)');
tq.executeSql('INSERT INTO LOGS (id, log) VALUES (1, &quot;Camera&quot;)');
tq.executeSql('INSERT INTO LOGS (id, log) VALUES (2, &quot;Konica&quot;)');
});</pre>
<h3>READ Operation</h3>
<p>To read records from the database we use a callback to capture the results as shown below:</p>
<pre class="brush: jscript; title: ; notranslate">var dbs = openDatabase('mydbs', '1.0', 'test1db', 2*1024*1024);
dbs.transaction(function(tq)) {
tq.executeSql('CREATE TABLE IF NOT EXISTS LOGS (id unique, log)');
tq.executeSql('INSERT INTO LOGS (id, log) VALUES (1, &quot;Camera&quot;)');
tq.executeSql('INSERT INTO LOGS (id, log) VALUES (2, &quot;Konica&quot;)');
});</pre>
<pre class="brush: jscript; title: ; notranslate">dbs.transaction (function(tq)) {
tq.executeSql('SELECT * FROM LOGS', [ ], function(tq, result) {
var length = result.rows.length, i;
msg = &quot;&lt;p&gt; Found rows: &quot;+ length + &quot;&lt;/p&gt;&quot;;
document.querySelector('#status').innerHTML += msg;
for (i=0; i&lt;length; i++) {
alert (result.rows.item (i). log);
}
}, null);
});</pre>
<h2>Web SQL database in HTML5 vs IndexedDB</h2>
<p>The Web SQL database is a deprecated specification since November 2010, the browser vendors are not encouraged to support this technology. The replacement is IndexedDB. It is a ‘NoSQL’ database and lets us create an Object Store for a type of data. Each Object Store can have a collection of Indexes that make it efficient to query and iterate across.</p>
<p>Some of the disadvantages of Web SQL are as follows:</p>
<ul>
<li>Web SQL is not object-driven.</li>
<li>SQL language needs to be mastered and JavaScript objects has to be transformed into relational schema.</li>
<li>Transaction creation is explicit, default is to rollback unless we call commit.</li>
</ul>
<p>Advantages of IndexedDB over Web SQL:</p>
<ul>
<li>Allows fast indexing and searching of objects, so you can manage your data and read/write it fast.</li>
<li>Indexing of JavaScript objects based on your application needs.</li>
<li>Granular locking per transaction, which allows us to work inside the event-driven JavaScript module.</li>
</ul>
<h2>Conclusion</h2>
<p>As Web SQL is deprecated, the web developers are recommended to stop using this technology in new projects, as the spec will not receive new updates. As a ‘NoSQL’ database, IndexedDB provides us a lot of power as it is different from relational database. Web Storage technique provides rich query abilities and is available both in offline and online mode, and can used to store large amount of data.</p>
<p>The post <a href="https://jharaphula.com/web-storage-web-sql-in-html5/">Using LocalStorage Objects vs Web SQL Database in HTML5</a> appeared first on <a href="https://jharaphula.com">OneStop Shop</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://jharaphula.com/web-storage-web-sql-in-html5/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			<media:content url="https://jharaphula.com/wp-content/uploads/2016/05/web-storage-in-html5.jpg" medium="image" />
	</item>
		<item>
		<title>Using HTML5 Application Cache for Offline Storage</title>
		<link>https://jharaphula.com/html5-application-cache-offline-storage/</link>
					<comments>https://jharaphula.com/html5-application-cache-offline-storage/#respond</comments>
		
		<dc:creator><![CDATA[Nibedita Panda]]></dc:creator>
		<pubDate>Sun, 15 May 2016 13:04:01 +0000</pubDate>
				<category><![CDATA[Learn HTML5 with Examples]]></category>
		<category><![CDATA[Cache for Offline Storage]]></category>
		<category><![CDATA[HTML5 Examples]]></category>
		<category><![CDATA[List of HTML5 new Tags]]></category>
		<category><![CDATA[Using HTML5 Application Cache]]></category>
		<category><![CDATA[What is a Manifest File?]]></category>
		<guid isPermaLink="false">http://box.jharaphula.com/?p=1512</guid>

					<description><![CDATA[<img width="300" height="180" src="https://jharaphula.com/wp-content/uploads/2016/05/html5-topper-300x180.png" class="webfeedsFeaturedVisual wp-post-image" alt="Using HTML5 Application Cache for Offline Storage" style="display: block; margin-bottom: 10px; clear: both; max-width: 100%;" decoding="async" loading="lazy" srcset="https://jharaphula.com/wp-content/uploads/2016/05/html5-topper-300x180.png 300w, https://jharaphula.com/wp-content/uploads/2016/05/html5-topper.png 750w" sizes="auto, (max-width: 300px) 100vw, 300px" /><p>How it is for consecutive access of your webpages if the user don&#8217;t need to send a request to the server? Here I mean to...</p>
<p>The post <a href="https://jharaphula.com/html5-application-cache-offline-storage/">Using HTML5 Application Cache for Offline Storage</a> appeared first on <a href="https://jharaphula.com">OneStop Shop</a>.</p>
]]></description>
										<content:encoded><![CDATA[<img width="300" height="180" src="https://jharaphula.com/wp-content/uploads/2016/05/html5-topper-300x180.png" class="webfeedsFeaturedVisual wp-post-image" alt="Using HTML5 Application Cache for Offline Storage" style="display: block; margin-bottom: 10px; clear: both; max-width: 100%;" decoding="async" loading="lazy" srcset="https://jharaphula.com/wp-content/uploads/2016/05/html5-topper-300x180.png 300w, https://jharaphula.com/wp-content/uploads/2016/05/html5-topper.png 750w" sizes="auto, (max-width: 300px) 100vw, 300px" /><p>How it is for consecutive access of your webpages if the user don&#8217;t need to send a request to the server? Here I mean to say &#8220;we can keep a local copy in the client machine/browser so for consecutive accesses browser will take the data from the local Copy&#8221;. This is what <a href="https://jharaphula.com/category/programming-solutions/html5-examples/" target="_blank" rel="noopener noreferrer">HTML5</a> Application Cache do in HTML5. Advantages of using Application Cache are Offline Browsing, Speed &amp; Reduced Server Load. Google Chrome 4.0, Internet Explorer 10.0, Mozilla Firefox 3.5, Safari 4.0, Opera 12 &amp; all the above versions Supports HTML5 Application Cache.</p>
<h3>What is a Manifest File?</h3>
<p>Generally this file comes with the extension &#8220;.appcache&#8221;. To enable Application Cache for your page you need to declare manifest in html tag.</p>
<pre class="brush: xml; title: ; notranslate">&lt;!DOCTYPE HTML&gt;
&lt;html manifest=&quot;demo.appcache&quot;&gt;
...
&lt;/html&gt;</pre>
<p>Manifest file is simple text file. You can create this using Notepad. It has 3 sections Cache Manifest, Network &amp; Fallback.</p>
<h3>demo.appcache</h3>
<pre class="brush: xml; title: ; notranslate">CACHE MANIFEST
# 2012-02-21 v1.0.0
/theme.css
/logo.gif
/main.js

NETWORK:
login.asp

FALLBACK:
/html/ /offline.html</pre>
<h3>Cache Manifest</h3>
<p>File listed under this block will immediately cache after they downloaded for the first time. Generally images, Static HTML, Common used JS &amp; CSS files we kept in Cache Manifest. This technique gives offline browsing as well better performance.</p>
<h3>Network</h3>
<p>File listed under this block will never Cache. For Consecutive requests these file required server connection.</p>
<h3>Fallback</h3>
<p>Files listed under this block specifies fallback pages if a page is inaccessible.</p>
<p>The post <a href="https://jharaphula.com/html5-application-cache-offline-storage/">Using HTML5 Application Cache for Offline Storage</a> appeared first on <a href="https://jharaphula.com">OneStop Shop</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://jharaphula.com/html5-application-cache-offline-storage/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			<media:content url="https://jharaphula.com/wp-content/uploads/2016/05/html5-topper.png" medium="image" />
	</item>
		<item>
		<title>Example to Implement HTML5 Drag and Drop with list of Events</title>
		<link>https://jharaphula.com/example-html5-drag-and-drop/</link>
					<comments>https://jharaphula.com/example-html5-drag-and-drop/#respond</comments>
		
		<dc:creator><![CDATA[Nibedita Panda]]></dc:creator>
		<pubDate>Sun, 15 May 2016 13:01:06 +0000</pubDate>
				<category><![CDATA[Learn HTML5 with Examples]]></category>
		<category><![CDATA[Drag and Drop with list of Events]]></category>
		<category><![CDATA[HTML5 Drag and Drop]]></category>
		<category><![CDATA[HTML5 Examples]]></category>
		<category><![CDATA[Introduction to HTML5]]></category>
		<guid isPermaLink="false">http://box.jharaphula.com/?p=1510</guid>

					<description><![CDATA[<img width="300" height="173" src="https://jharaphula.com/wp-content/uploads/2016/05/drop-n-drop-300x173.jpg" class="webfeedsFeaturedVisual wp-post-image" alt="Example to implement html5 drag and drop with list of Events" style="display: block; margin-bottom: 10px; clear: both; max-width: 100%;" decoding="async" loading="lazy" srcset="https://jharaphula.com/wp-content/uploads/2016/05/drop-n-drop-300x173.jpg 300w, https://jharaphula.com/wp-content/uploads/2016/05/drop-n-drop.jpg 750w" sizes="auto, (max-width: 300px) 100vw, 300px" /><p>You must remember during the age of HTML4 to implement drag and drop feature generally we do Scripting. This problem is addressed in HTML5. Using...</p>
<p>The post <a href="https://jharaphula.com/example-html5-drag-and-drop/">Example to Implement HTML5 Drag and Drop with list of Events</a> appeared first on <a href="https://jharaphula.com">OneStop Shop</a>.</p>
]]></description>
										<content:encoded><![CDATA[<img width="300" height="173" src="https://jharaphula.com/wp-content/uploads/2016/05/drop-n-drop-300x173.jpg" class="webfeedsFeaturedVisual wp-post-image" alt="Example to implement html5 drag and drop with list of Events" style="display: block; margin-bottom: 10px; clear: both; max-width: 100%;" decoding="async" loading="lazy" srcset="https://jharaphula.com/wp-content/uploads/2016/05/drop-n-drop-300x173.jpg 300w, https://jharaphula.com/wp-content/uploads/2016/05/drop-n-drop.jpg 750w" sizes="auto, (max-width: 300px) 100vw, 300px" /><p>You must remember during the age of HTML4 to implement drag and drop feature generally we do Scripting. This problem is addressed in <a href="https://jharaphula.com/category/programming-solutions/html5-examples/" target="_blank" rel="noopener noreferrer">HTML5</a>. Using HTML5 you don&#8217;t need to depend upon Scripts. There are per-defined APIs using which we can easily implement HTML5 Drag and Drop feature. Drag and Drop makes life easier. It saves user Time. <strong>Operations like Copy, Reorder &amp; Deletion</strong> can be more user friendly using Drag and Drop.</p>
<p>Let&#8217;s discuss about the scenario where I have 2 divs. In first div there is an image which I want to drag into the 2nd div. Here my 2nd div acts like a container. Look at the example in below:</p>
<h3>Example</h3>
<pre class="brush: xml; title: ; notranslate">&lt;!DOCTYPE html&gt;
&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot; &gt;
&lt;head&gt;
&lt;title&gt;Example of HTML5 Drag n Drop&lt;/title&gt;
&lt;style type=&quot;text/css&quot;&gt;
.container
{
border: 1px solid #aaaaaa;
height: 152px;
padding: 10px;
margin-right: 10px;
width: 150px;
float:left;
}
&lt;/style&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
function allowDrop(ev) {
ev.preventDefault();
}

function dragImage(ev) {
ev.dataTransfer.setData(&quot;text&quot;, ev.target.id);
}

function dropImage(ev) {
ev.preventDefault();
var data = ev.dataTransfer.getData(&quot;text&quot;);
ev.target.appendChild(document.getElementById(data));
}
&lt;/script&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;div class=&quot;container&quot; ondrop=&quot;dropImg(event)&quot; ondragover=&quot;allowDrop(event)&quot;&gt;&lt;/div&gt;
&lt;div class=&quot;container&quot;&gt;
&lt;img id=&quot;dragimg&quot; draggable=&quot;true&quot; src=&quot;drag-pattern.png&quot; ondragstart=&quot;dragImage(event)&quot;&gt;
&lt;/div&gt;
&lt;/body&gt;
&lt;/html&gt;</pre>
<h3>HTML5 Drag and Drop Events</h3>
<p>HTML5 Drag and Drop API provides the following events.</p>
<p><strong>dragstart</strong>: This event occurs when the user starts dragging the object. Generally we use this event to show errors. I mean if an user dragging object into an area where drop facility is not available using dragstart we can show the error message.</p>
<p><strong>dragenter</strong>: Using mouse while you are dragging an object during that time this event occurs.</p>
<p><strong>dragover</strong>: This event occurs as the mouse is moved over an element during dragging.</p>
<p><strong>dragleave</strong>: This event occurs when the mouse leaves an element during dragging.</p>
<p><strong>drag</strong>: This event occurs every time the mouse is moved during the object is being dragged.</p>
<p><strong>drop</strong>: This event occurs at the end of the drag operation.</p>
<p><strong>dragend</strong>: This event occurs when the user releases the mouse button during dragging.</p>
<p>HTML5 Drag and Drop feature was supported by all the major browsers like Google Chrome 4.0, Mozilla FireFox 3.5, Safari 6.0, Internet Explorer 9.0, Opera 12 &amp; above versions.</p>
<p>The post <a href="https://jharaphula.com/example-html5-drag-and-drop/">Example to Implement HTML5 Drag and Drop with list of Events</a> appeared first on <a href="https://jharaphula.com">OneStop Shop</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://jharaphula.com/example-html5-drag-and-drop/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			<media:content url="https://jharaphula.com/wp-content/uploads/2016/05/drop-n-drop.jpg" medium="image" />
	</item>
		<item>
		<title>Introduction to HTML5 Web Workers with Example</title>
		<link>https://jharaphula.com/html5-web-workers/</link>
					<comments>https://jharaphula.com/html5-web-workers/#respond</comments>
		
		<dc:creator><![CDATA[Nibedita Panda]]></dc:creator>
		<pubDate>Sun, 15 May 2016 12:26:16 +0000</pubDate>
				<category><![CDATA[Learn HTML5 with Examples]]></category>
		<category><![CDATA[5th revision of HTML]]></category>
		<category><![CDATA[Document Object Model]]></category>
		<category><![CDATA[HTML5 Web Workers]]></category>
		<category><![CDATA[Introduction to HTML5]]></category>
		<category><![CDATA[List of HTML5 new Tags]]></category>
		<category><![CDATA[Web Workers with Example]]></category>
		<guid isPermaLink="false">http://box.jharaphula.com/?p=1484</guid>

					<description><![CDATA[<img width="300" height="186" src="https://jharaphula.com/wp-content/uploads/2016/05/html5-web-wroker-example-300x186.jpg" class="webfeedsFeaturedVisual wp-post-image" alt="Introduction to HTML5 Web Workers with Example" style="display: block; margin-bottom: 10px; clear: both; max-width: 100%;" decoding="async" loading="lazy" srcset="https://jharaphula.com/wp-content/uploads/2016/05/html5-web-wroker-example-300x186.jpg 300w, https://jharaphula.com/wp-content/uploads/2016/05/html5-web-wroker-example.jpg 750w" sizes="auto, (max-width: 300px) 100vw, 300px" /><p>You must noticed about the execution of JavaScript in a HTML page. Unless until the execution get finish page act like unresponsive. Some time it...</p>
<p>The post <a href="https://jharaphula.com/html5-web-workers/">Introduction to HTML5 Web Workers with Example</a> appeared first on <a href="https://jharaphula.com">OneStop Shop</a>.</p>
]]></description>
										<content:encoded><![CDATA[<img width="300" height="186" src="https://jharaphula.com/wp-content/uploads/2016/05/html5-web-wroker-example-300x186.jpg" class="webfeedsFeaturedVisual wp-post-image" alt="Introduction to HTML5 Web Workers with Example" style="display: block; margin-bottom: 10px; clear: both; max-width: 100%;" decoding="async" loading="lazy" srcset="https://jharaphula.com/wp-content/uploads/2016/05/html5-web-wroker-example-300x186.jpg 300w, https://jharaphula.com/wp-content/uploads/2016/05/html5-web-wroker-example.jpg 750w" sizes="auto, (max-width: 300px) 100vw, 300px" /><p>You must noticed about the execution of JavaScript in a HTML page. Unless until the execution get finish page act like unresponsive. Some time <strong>it also hang your browser where CPU utilization is high</strong>. To overtake this problem <a href="https://jharaphula.com/category/programming-solutions/html5-examples/" target="_blank" rel="noopener noreferrer">HTML5</a> Introduced Web Workers. Using HTML5 web workers we can execute any number of scripts <strong>independently in background without affecting the page performance</strong>. While a script is executing inside a Web Workers, it cannot access the properties of Document Object Model (DOM). Web Workers allow for long-running scripts that are not interrupted by scripts that respond to clicks or other user interactions.</p>
<h3>Example of Web Workers</h3>
<pre class="brush: xml; title: ; notranslate">&lt;!DOCTYPE html&gt;
&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot; &gt;
&lt;head&gt;
&lt;title&gt;Example of HTML5 Web Worker&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;div&gt;Count numbers: &lt;output id=&quot;showResult&quot;&gt;&lt;/output&gt;&lt;/div&gt;
&lt;button onclick=&quot;startWebWorker()&quot;&gt;Start Web Worker&lt;/button&gt;
&lt;button onclick=&quot;stopWebWorker()&quot;&gt;Stop Web Worker&lt;/button&gt;

&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; IE 9 &amp;amp; pervious versions don't support HTML5 Web Workers.&lt;/p&gt;

&lt;script type=&quot;text/javascript&quot;&gt;
var w;

function startWebWorker() {
if(typeof(Worker) !== &quot;undefined&quot;) {
if(typeof(w) == &quot;undefined&quot;) {
w = new Worker(&quot;web_workers.js&quot;);
}
w.onmessage = function(event) {
document.getElementById(&quot;showResult&quot;).innerHTML = event.data;
};
} else {
document.getElementById(&quot;showResult&quot;).innerHTML = &quot;Sorry, Please update your Browser...&quot;;
}
}

function stopWebWorker() {
w.terminate();
w = undefined;
}
&lt;/script&gt;
&lt;/body&gt;
&lt;/html&gt;</pre>
<h3>How Web Workers Work?</h3>
<p>Using new keyword to initiate a web worker we required the path of a JavaScript file. Which file contains the actual code for operations. In your application if has multiple supporting javascript files, you can import them <strong>importScripts()</strong> method. Communication between web worker and its parent page is done using the postMessage() method. <strong>postMessage()</strong> can accept either a JSON object or string as the argument. Message passed by Web Worker is accessible in main page using <strong>onmessage</strong> event. To stop web worker you can use <strong>terminate()</strong> method.</p>
<h3>How to Create a HTML5 Web Workers File?</h3>
<p>Refer to the above example I have the web worker file is web_workers.js. Look at the below example how I created this js file. Normally we use web workers for more CPU intensive tasks not for simple scripts.</p>
<pre class="brush: jscript; title: ; notranslate">var i = 0;
function countDown() {
    i = i + 1;
    postMessage(i);
    setTimeout(&quot;countDown()&quot;,500);
}
countDown();</pre>
<h3>Which Browsers does it Supports?</h3>
<p>HTML5 Web Workers supported by IE 10, Chrome 4.0, Mozilla Firefox 3.5, Safari 4.0, Opera 11.5 &amp; above versions.</p>
<p>The post <a href="https://jharaphula.com/html5-web-workers/">Introduction to HTML5 Web Workers with Example</a> appeared first on <a href="https://jharaphula.com">OneStop Shop</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://jharaphula.com/html5-web-workers/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			<media:content url="https://jharaphula.com/wp-content/uploads/2016/05/html5-web-wroker-example.jpg" medium="image" />
	</item>
		<item>
		<title>Using XMLHttpRequest How to Bind Data from XML to HTML Table?</title>
		<link>https://jharaphula.com/xmlhttprequest-bind-xml-to-html-table/</link>
					<comments>https://jharaphula.com/xmlhttprequest-bind-xml-to-html-table/#comments</comments>
		
		<dc:creator><![CDATA[Nibedita Panda]]></dc:creator>
		<pubDate>Sun, 15 May 2016 07:36:40 +0000</pubDate>
				<category><![CDATA[Learn HTML5 with Examples]]></category>
		<category><![CDATA[Bind Data from XML to HTML]]></category>
		<category><![CDATA[How to Bind Data?]]></category>
		<category><![CDATA[JavaScript Developers]]></category>
		<category><![CDATA[Learn XML]]></category>
		<category><![CDATA[XML to HTML Table]]></category>
		<guid isPermaLink="false">http://box.jharaphula.com/?p=1344</guid>

					<description><![CDATA[<img width="300" height="188" src="https://jharaphula.com/wp-content/uploads/2016/05/data-binding-from-xml-300x188.jpg" class="webfeedsFeaturedVisual wp-post-image" alt="Using XMLHttpRequest how to bind data from XML to HTML table" style="display: block; margin-bottom: 10px; clear: both; max-width: 100%;" decoding="async" loading="lazy" srcset="https://jharaphula.com/wp-content/uploads/2016/05/data-binding-from-xml-300x188.jpg 300w, https://jharaphula.com/wp-content/uploads/2016/05/data-binding-from-xml.jpg 750w" sizes="auto, (max-width: 300px) 100vw, 300px" /><p>XML is a lightweight platform independent technology to describe data &#38; HTML is responsible to display data as per the user demand. Let&#8217;s take a...</p>
<p>The post <a href="https://jharaphula.com/xmlhttprequest-bind-xml-to-html-table/">Using XMLHttpRequest How to Bind Data from XML to HTML Table?</a> appeared first on <a href="https://jharaphula.com">OneStop Shop</a>.</p>
]]></description>
										<content:encoded><![CDATA[<img width="300" height="188" src="https://jharaphula.com/wp-content/uploads/2016/05/data-binding-from-xml-300x188.jpg" class="webfeedsFeaturedVisual wp-post-image" alt="Using XMLHttpRequest how to bind data from XML to HTML table" style="display: block; margin-bottom: 10px; clear: both; max-width: 100%;" decoding="async" loading="lazy" srcset="https://jharaphula.com/wp-content/uploads/2016/05/data-binding-from-xml-300x188.jpg 300w, https://jharaphula.com/wp-content/uploads/2016/05/data-binding-from-xml.jpg 750w" sizes="auto, (max-width: 300px) 100vw, 300px" /><p><a href="https://jharaphula.com/learn-xml-online-tutorial-beginners/" target="_blank" rel="noopener noreferrer">XML is a lightweight platform independent technology</a> to describe data &amp; HTML is responsible to display data as per the user demand. Let’s take a case where you have your employee’s data in a XML file. During development in a HTML page you want to display details of your employees in html table. Here JavaScript &amp; XMLHttpRequest object comes into picture. Yes using JavaScript we can easily bind data from XML to HTML table.</p>
<p>Look at the below example here I have an xml file “employeeDetails.xml” which contain data related employees. In index.html I want to display these data’s in html table. To do show in index.html I implemented some JavaScript. In side script block first I am creating an object for XMLHttpRequest then using its open method fetching data from the xml file. Then from the response object to get each record I am using getElementsByTagName method. Where tag name is the employeeDetails attribute from XML file. After getting employee details executing a loop to fetch all the records. To create table using document.write method &amp; inside the respective tr &amp; td added XML node values.</p>
<h3>xml-to-html-table.htm</h3>
<pre class="brush: xml; title: ; notranslate">&lt;html&gt;
&lt;head&gt;
&lt;style&gt;
table, th, td {
border: thin solid gray;
padding: 5px;
text-align: left;
border-collapse: collapse;
}
&lt;/style&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
if (window.XMLHttpRequest)
{
// for IE7+, Firefox, Google Chrome &amp; Safari
xmlhttp=new XMLHttpRequest();
}
else
{
// for IE6, IE5.
xmlhttp=new ActiveXObject(&quot;Microsoft.XMLHTTP&quot;);
}
xmlhttp.open(&quot;GET&quot;,&quot;employeeDetails.xml&quot;,false);
xmlhttp.send();
xmlDoc=xmlhttp.responseXML;
&amp;nbsp;
document.write(&quot;&lt;table&gt;&lt;tr&gt;&lt;th&gt;Name&lt;/th&gt;&lt;th&gt;Designation&lt;/th&gt;&lt;th&gt;Salary&lt;/th&gt;&lt;/tr&gt;&quot;);
var records=xmlDoc.getElementsByTagName(&quot;employee&quot;);
for (i=0;i&lt;records.length;i++)
{
document.write(&quot;&lt;tr&gt;&lt;td&gt;&quot;);
document.write(records[i].getElementsByTagName(&quot;Name&quot;)[0].childNodes[0].nodeValue);
document.write(&quot;&lt;/td&gt;&lt;td&gt;&quot;);
document.write(records[i].getElementsByTagName(&quot;Designation&quot;)[0].childNodes[0].nodeValue);
document.write(&quot;&lt;/td&gt;&lt;td&gt;&quot;);
document.write(records[i].getElementsByTagName(&quot;Salary&quot;)[0].childNodes[0].nodeValue);
document.write(&quot;&lt;/td&gt;&lt;/tr&gt;&quot;);
}
document.write(&quot;&lt;/table&gt;&quot;);
&lt;/script&gt;
&amp;nbsp;
&lt;/body&gt;
&lt;/html&gt;
&amp;nbsp;</pre>
<h3>employeeDetails.xml</h3>
<pre class="brush: xml; title: ; notranslate">&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
&lt;company&gt;
&lt;employee&gt;
&lt;Name&gt;Biswabhusan Panda&lt;/Name&gt;
&lt;Age&gt;32&lt;/Age&gt;
&lt;Designation&gt;Sr. Process Lead&lt;/Designation&gt;
&lt;Salary&gt;56000&lt;/Salary&gt;
&lt;/ employee&gt;
&lt; employee&gt;
&lt;Name&gt;Shilpa Ghose&lt;/Name&gt;
&lt;Age&gt;23&lt;/Age&gt;
&lt;Designation&gt;HRM&lt;/Designation&gt;
&lt;Salary&gt;26000&lt;/Salary&gt;
&lt;/ employee&gt;
&lt; employee&gt;
&lt;Name&gt;Jaya Mishra&lt;/Name&gt;
&lt;Age&gt;35&lt;/Age&gt;
&lt;Designation&gt;Sr. Technical Lead&lt;/Designation&gt;
&lt;Salary&gt;76000&lt;/Salary&gt;
&lt;/ employee&gt;
&lt;/ company &gt;</pre>
<p>The post <a href="https://jharaphula.com/xmlhttprequest-bind-xml-to-html-table/">Using XMLHttpRequest How to Bind Data from XML to HTML Table?</a> appeared first on <a href="https://jharaphula.com">OneStop Shop</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://jharaphula.com/xmlhttprequest-bind-xml-to-html-table/feed/</wfw:commentRss>
			<slash:comments>2</slash:comments>
		
		
			<media:content url="https://jharaphula.com/wp-content/uploads/2016/05/data-binding-from-xml.jpg" medium="image" />
	</item>
		<item>
		<title>HTML5 Video Player with Play, Forward, Rewind &#038; Pause buttons</title>
		<link>https://jharaphula.com/html5-video-player-with-play-forward-rewind-pause-buttons/</link>
					<comments>https://jharaphula.com/html5-video-player-with-play-forward-rewind-pause-buttons/#comments</comments>
		
		<dc:creator><![CDATA[Biswabhusan Panda]]></dc:creator>
		<pubDate>Sat, 14 May 2016 18:53:42 +0000</pubDate>
				<category><![CDATA[Learn HTML5 with Examples]]></category>
		<category><![CDATA[5th revision of HTML]]></category>
		<category><![CDATA[HTML5 Video Player]]></category>
		<category><![CDATA[List of HTML5 new Tags]]></category>
		<guid isPermaLink="false">http://box.jharaphula.com/?p=1234</guid>

					<description><![CDATA[<img width="300" height="184" src="https://jharaphula.com/wp-content/uploads/2016/05/video-player-300x184.jpg" class="webfeedsFeaturedVisual wp-post-image" alt="HTML5 video player with play, forward, rewind &amp; pause buttons" style="display: block; margin-bottom: 10px; clear: both; max-width: 100%;" decoding="async" loading="lazy" srcset="https://jharaphula.com/wp-content/uploads/2016/05/video-player-300x184.jpg 300w, https://jharaphula.com/wp-content/uploads/2016/05/video-player.jpg 750w" sizes="auto, (max-width: 300px) 100vw, 300px" /><p>As we know HTML5 is rich with media elements. Using HTML5 media elements we can easily embed any Audio or Video to our web pages....</p>
<p>The post <a href="https://jharaphula.com/html5-video-player-with-play-forward-rewind-pause-buttons/">HTML5 Video Player with Play, Forward, Rewind &amp; Pause buttons</a> appeared first on <a href="https://jharaphula.com">OneStop Shop</a>.</p>
]]></description>
										<content:encoded><![CDATA[<img width="300" height="184" src="https://jharaphula.com/wp-content/uploads/2016/05/video-player-300x184.jpg" class="webfeedsFeaturedVisual wp-post-image" alt="HTML5 video player with play, forward, rewind &amp; pause buttons" style="display: block; margin-bottom: 10px; clear: both; max-width: 100%;" decoding="async" loading="lazy" srcset="https://jharaphula.com/wp-content/uploads/2016/05/video-player-300x184.jpg 300w, https://jharaphula.com/wp-content/uploads/2016/05/video-player.jpg 750w" sizes="auto, (max-width: 300px) 100vw, 300px" /><p>As we know HTML5 is rich with media elements. Using HTML5 media elements we can easily embed any Audio or Video to our web pages. HTML5 supports 2 kind of video and audio formats .ogg and .mpeg. If your video is in other formats you can use any online or offline tools to convert your video. In this example here I created a Video Player using <a href="https://jharaphula.com/category/programming-solutions/html5-examples/" target="_blank" rel="noopener noreferrer">HTML5</a> Video element. To operate the video in this player <strong>I did implemented play, forward, rewind and pause buttons functionalities using JavaScript functions</strong>. Logic I implemented is very simple. In HTML body I have a video element with source video file (<em>laugh-vid.mp4</em>) path. Including this 4 buttons are there Reload, Rewind, Play &amp; Forward. On click of these buttons I am calling the respective js functions.</p>
<p>Play button behaves dynamically. Once you click on this video it starts playing. While running video the same button works like a pause button. You can stop you video in-between using pause functionality. Reload button is responsible to start video from beginning. <strong>About rewind &amp; forward buttons I have a function forwardRewind(), it accepts param as parameter</strong>. In case user click on rewind button I am passing -7 to back the track. Similarly for forward button I am passing +7. You can change this value depending your video length. To play the video here in JS function I am using .play method.</p>
<h2>HTML5 Video Player Demo App</h2>
<pre class="brush: xml; title: ; notranslate">&lt;!DOCTYPE html&gt;
&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;
&lt;head&gt;
&lt;title&gt;HTML5 video player with play, forward, rewind &amp; pause buttons&lt;/title&gt;
&lt;!--Embed the below JS Script here--&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;video id=&quot;videoPlayer&quot;&gt;
&lt;source src=&quot;laugh-vid.mp4&quot; type=&quot;video/mp4&quot; /&gt;
&lt;/video&gt;
&lt;!--Buttons for Video Player--&gt;
&lt;div id=&quot;playerButtons&quot;&gt;
&lt;button id=&quot;btnReload&quot; onclick=&quot;reloadVideo();&quot;&gt;[]&lt;/button&gt;
&lt;button id=&quot;btnRewind&quot; onclick=&quot;forwardRewind(-7)&quot;&gt;&lt;&lt;&lt;/button&gt;
&lt;button id=&quot;btnPlay&quot; onclick=&quot;play()&quot;&gt;&gt;&lt;/button&gt;
&lt;button id=&quot;btnForward&quot; onclick=&quot;forwardRewind(7)&quot;&gt;&gt;&gt;&lt;/button&gt;
&lt;/div&gt;
&lt;/body&gt;
&lt;/html&gt;</pre>
<h2>JS Functions for HTML5 Video Player</h2>
<p>The major advantages of using HTML5 Video element is it is browser friendly and can be operate using the popular Client-side script Javascript. As we discussed above here for 4 buttons I am using few JS functions. Sharing the code below. While placing the above Code inside your HTML file use script tag.</p>
<pre class="brush: jscript; title: ; notranslate">
/*Function for Play &amp;amp; Pause Buttons*/
function play() {
var videoPlayer = document.getElementById(&quot;videoPlayer&quot;);
var btnPlay = document.getElementById(&quot;btnPlay&quot;);
if (videoPlayer.paused) {
videoPlayer.play();
btnPlay.textContent = &quot;||&quot;;
} else {
videoPlayer.pause();
btnPlay.textContent = &quot;&amp;gt;&quot;;
}
}
/*Function to Reload video from Beginning*/
function reloadVideo() {
var videoPlayer = document.getElementById(&quot;videoPlayer&quot;);
videoPlayer.currentTime = 0;
}
/*Function to Forward &amp;amp; Rewind*/
function forwardRewind(param) {
var videoPlayer = document.getElementById(&quot;videoPlayer&quot;);
videoPlayer.currentTime += param;
}
</pre>
<h2>HTML5 Video tag Attributes</h2>
<p><strong>autoplay</strong>: This is a boolean attribute. Using this you can play your video after the page loaded successfully. User don&#8217;t need to click on play button.</p>
<p><strong>autobuffer</strong>: Using this attribute video will automatically begin buffering even if it&#8217;s not set to automatically play.</p>
<p><strong>controls</strong>: Using controls attribute user can control video settings like playback, including decreasing or increasing volume, seeking, and pause or resume playback. If you don&#8217;t specify the controls attribute, the video won&#8217;t include the browser&#8217;s default controls.</p>
<p><strong>height</strong>: This attribute helps to Set height of the video area using CSS pixels.</p>
<p><strong>width</strong>: This attribute helps to Set width of the video area using CSS pixels.</p>
<p><strong>loop</strong>: If you want your video need to play n number of times until or unless user toggle an event. You can set loop to &#8220;true&#8221;.</p>
<p><strong>src</strong>: src stands for source. Here you need to place your video or audio link. In the place of URL you can use your local drive path or a link.</p>
<p><strong>poster</strong>: Until your video start playing this attribute helps to show a static image in the player.</p>
<p>Using HTML5 video element you can use your youtube videos. Just place the link as a value to src attribute. As a technical tips for any resolution you are going to place your video player keep width 100%. Height varies from place to place.</p>
<h2>Future of HTML5 Video Players</h2>
<p>HTML5 video players have revolutionized the way we consume digital media, offering seamless playback across devices without requiring third-party plugins. As web technologies continue to advance, new features and APIs are shaping the future of video playback, making it more interactive, efficient, and user-friendly. Key innovations such as Picture-in-Picture (PiP) mode, the Media Session API, and WebCodecs are driving this evolution, ensuring that HTML5 video players remain at the forefront of online media delivery.</p>
<p><strong>Picture-in-Picture (PiP) Mode</strong></p>
<p>Picture-in-Picture (PiP) is a feature that allows users to watch a video in a small floating window while interacting with other applications or browsing the web. Initially popularized by desktop applications, PiP has now become a standard feature in modern browsers, enhancing multitasking capabilities.</p>
<p><strong>Media Session API</strong></p>
<p>The Media Session API allows web applications to provide a consistent media playback experience by integrating with the operating system’s media controls. This API enables metadata display (e.g., title, artist, album art) and playback controls (play, pause, seek) in system-level media interfaces, such as notification panels and lock screens.</p>
<p><strong>WebCodecs</strong></p>
<p>WebCodecs is a low-level API that provides direct access to media encoding and decoding capabilities, bypassing the need for high-level abstractions.</p>
<p>These innovations ensure HTML5 remains the dominant solution for web-based video playback.</p>
<h2>Conclusion</h2>
<p>The HTML5 video player has become the cornerstone of modern web media, offering a seamless, secure, and versatile way to deliver video content. Its native integration, customization options, and broad compatibility make it the preferred choice for developers and content creators. As web technologies advance, HTML5 video players will continue to set the standard for online video experiences.</p>
<p>The post <a href="https://jharaphula.com/html5-video-player-with-play-forward-rewind-pause-buttons/">HTML5 Video Player with Play, Forward, Rewind &amp; Pause buttons</a> appeared first on <a href="https://jharaphula.com">OneStop Shop</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://jharaphula.com/html5-video-player-with-play-forward-rewind-pause-buttons/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			<media:content url="https://jharaphula.com/wp-content/uploads/2016/05/video-player.jpg" medium="image" />
	</item>
		<item>
		<title>How to Save image Offline using HTML5 Local Storage?</title>
		<link>https://jharaphula.com/save-image-offline-html5-local-storage/</link>
					<comments>https://jharaphula.com/save-image-offline-html5-local-storage/#respond</comments>
		
		<dc:creator><![CDATA[Biswabhusan Panda]]></dc:creator>
		<pubDate>Fri, 13 May 2016 18:43:40 +0000</pubDate>
				<category><![CDATA[Learn HTML5 with Examples]]></category>
		<category><![CDATA[How to Save image?]]></category>
		<category><![CDATA[HTML5 Local Storage]]></category>
		<category><![CDATA[image to Base 64 data url]]></category>
		<category><![CDATA[Save image Offline]]></category>
		<guid isPermaLink="false">http://box.jharaphula.com/?p=752</guid>

					<description><![CDATA[<img width="300" height="192" src="https://jharaphula.com/wp-content/uploads/2016/05/html5-web-300x192.jpg" class="webfeedsFeaturedVisual wp-post-image" alt="How to save image offline using HTML5 Local Storage?" style="display: block; margin-bottom: 10px; clear: both; max-width: 100%;" decoding="async" loading="lazy" srcset="https://jharaphula.com/wp-content/uploads/2016/05/html5-web-300x192.jpg 300w, https://jharaphula.com/wp-content/uploads/2016/05/html5-web.jpg 750w" sizes="auto, (max-width: 300px) 100vw, 300px" /><p>To improve performance of a web application we need to reduce server &#38; client communication as much as we can. This technique helps to improve...</p>
<p>The post <a href="https://jharaphula.com/save-image-offline-html5-local-storage/">How to Save image Offline using HTML5 Local Storage?</a> appeared first on <a href="https://jharaphula.com">OneStop Shop</a>.</p>
]]></description>
										<content:encoded><![CDATA[<img width="300" height="192" src="https://jharaphula.com/wp-content/uploads/2016/05/html5-web-300x192.jpg" class="webfeedsFeaturedVisual wp-post-image" alt="How to save image offline using HTML5 Local Storage?" style="display: block; margin-bottom: 10px; clear: both; max-width: 100%;" decoding="async" loading="lazy" srcset="https://jharaphula.com/wp-content/uploads/2016/05/html5-web-300x192.jpg 300w, https://jharaphula.com/wp-content/uploads/2016/05/html5-web.jpg 750w" sizes="auto, (max-width: 300px) 100vw, 300px" /><p>To improve performance of a web application we need to reduce server &amp; client communication as much as we can. This technique helps to <a href="https://jharaphula.com/best-practices-website-speed-performance/" target="_blank" rel="noopener noreferrer">improve performance of a web application</a>. Always it&#8217;s wise for a programmer to store static data in client browser. Except for the first time but every time while user will request the same page from the serve we need to check whether the similar data exists in the client memory or not. If the similar data exist in the client memory we need to load this data to reduce server &amp; client communication. In this way to achieve this we need to store our static data in the client browser memory. To make this process easier HTML5 introduced Local Storage. Which stores data in client browser for the unlimited time we want. Compare to session storage html5 local storage stored data after user interaction. I can say html5 local storage is like a offline data store.</p>
<p>During web application development we do integrate many images to our application to make our application more user attractive. Here images are static data. If the user is requesting the similar page 10 times from his/her browser we need to avoid server interaction for nine times rather then for the first one. So in this session let us know how to save image in html5 local storage.</p>
<p>In the below example I am storing an image to HTML5 local storage. In HTML body here I have 2 images imageToLoadInLocalStorage &amp; imageToShowFromLocalStorage. The first image has a src attribute which loads a png image (<em>global-img.png</em>) from server. Second image is having blank src attribute. Using client script here I am storing the first image to local storage &amp; fetching the similar image from local storage to my second image. The mechanism I used here is I am fetching the first image using DOM object method getElementById. Converting the image to Base 64 data url format &amp; storing it to local storage using localStorage.setItem() method. Then fetching the image from local storage using localStorage.getItem() method &amp; assign the image to my second image control.</p>
<p>To run the below example copy the codes into a notepad file. Save it as HTML. Then open the file using any browser which supports HTML5 storage. Before run the below app make sure you are with internet connectivity.</p>
<h3>Example to save image using HTML5 Local Storage</h3>
<pre class="brush: xml; title: ; notranslate">
&lt;title&gt;Demo app to save image using HTML5 Local Storage&lt;/title&gt;
&lt;!--CDN link of Jquery--&gt;
&lt;script src=&quot;http://code.jquery.com/jquery-1.10.2.js&quot;&gt;&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot;&gt;&lt;br /&gt;
/* Function to Convert image into Base64 */&lt;br /&gt;
function ConvertImageToBase64(imageToConvertBase64) {&lt;br /&gt;
/* Creating a Canvas in HTML5 */&lt;br /&gt;
var drawCanvas = document.createElement(&quot;canvas&quot;);&lt;br /&gt;
/* Setting the Canvas width &amp; height as refer to the Image */&lt;br /&gt;
drawCanvas.width = imageToConvertBase64.width;&lt;br /&gt;
drawCanvas.height = imageToConvertBase64.height;&lt;br /&gt;
/* Copy the image to Canvas */&lt;br /&gt;
var copyImageToCanvas = drawCanvas.getContext(&quot;2d&quot;);&lt;br /&gt;
copyImageToCanvas.drawImage(imageToConvertBase64, 0, 0);&lt;br /&gt;
/* Converting Image to Data URL */&lt;br /&gt;
var dataUrlOfImage = drawCanvas.toDataURL(&quot;image/png&quot;);&lt;br /&gt;
/* Returning Data URL of the Image */&lt;br /&gt;
return dataUrlOfImage.replace(/^data:image\/(png|jpg);base64,/, &quot;&quot;);&lt;br /&gt;
}&lt;/p&gt;
&lt;p&gt;$(document).ready(function() {&lt;br /&gt;
/* Fetching the image using JavaScript getElementById */&lt;br /&gt;
var imageToLoadInLocalStorage = document.getElementById('imageToLoadInLocalStorage');&lt;br /&gt;
/* Calling the function ConvertImageToBase64 to convert the Image to Base 64 */&lt;br /&gt;
var imageDataUrl = ConvertImageToBase64(imageToLoadInLocalStorage);&lt;br /&gt;
/* Storing the image in Local Storage using setItem() method */&lt;br /&gt;
localStorage.setItem(&quot;imageData&quot;, imageDataUrl);&lt;/p&gt;
&lt;p&gt;/* Using getItem() fetching the image from Local Storage */&lt;br /&gt;
var dataImageUrl = localStorage.getItem('imageData');&lt;br /&gt;
/* Using getElementById to detect the image control for loading local storage image */&lt;br /&gt;
var imageToShow = document.getElementById('imageToShowFromLocalStorage');&lt;br /&gt;
/* Assigning source to a blank image with id imageToShowFromLocalStorage */&lt;br /&gt;
imageToShow.src = &quot;data:image/png;base64,&quot; + dataImageUrl;&lt;br /&gt;
});&lt;br /&gt;
&lt;/script&gt;

&lt;!--Image with Source--&gt;
&lt;img src=&quot;global-img.png&quot; id=&quot;imageToLoadInLocalStorage&quot; /&gt;
&lt;!--Image with no Source to grab from Local Storage--&gt;
&lt;img src=&quot;&quot; id=&quot;imageToShowFromLocalStorage&quot; /&gt;
</pre>
<p>The post <a href="https://jharaphula.com/save-image-offline-html5-local-storage/">How to Save image Offline using HTML5 Local Storage?</a> appeared first on <a href="https://jharaphula.com">OneStop Shop</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://jharaphula.com/save-image-offline-html5-local-storage/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			<media:content url="https://jharaphula.com/wp-content/uploads/2016/05/html5-web.jpg" medium="image" />
	</item>
		<item>
		<title>List of HTML5 new Tags introduced in 5th revision of HTML</title>
		<link>https://jharaphula.com/list-of-html5-new-tags/</link>
					<comments>https://jharaphula.com/list-of-html5-new-tags/#respond</comments>
		
		<dc:creator><![CDATA[Nibedita Panda]]></dc:creator>
		<pubDate>Fri, 13 May 2016 17:26:21 +0000</pubDate>
				<category><![CDATA[Learn HTML5 with Examples]]></category>
		<category><![CDATA[5th revision of HTML]]></category>
		<category><![CDATA[Hypertext Markup Language]]></category>
		<category><![CDATA[List of HTML5 new Tags]]></category>
		<category><![CDATA[Tags introduced]]></category>
		<guid isPermaLink="false">http://box.jharaphula.com/?p=699</guid>

					<description><![CDATA[<img width="300" height="189" src="https://jharaphula.com/wp-content/uploads/2016/05/html5-browser-300x189.png" class="webfeedsFeaturedVisual wp-post-image" alt="List of HTML5 new Tags introduced in 5th revision of HTML" style="display: block; margin-bottom: 10px; clear: both; max-width: 100%;" decoding="async" loading="lazy" srcset="https://jharaphula.com/wp-content/uploads/2016/05/html5-browser-300x189.png 300w, https://jharaphula.com/wp-content/uploads/2016/05/html5-browser.png 750w" sizes="auto, (max-width: 300px) 100vw, 300px" /><p>HTML5 is the 5th Revision of Hypertext Markup Language. By simply adding to our HTML file we can instruct the browser that this file is...</p>
<p>The post <a href="https://jharaphula.com/list-of-html5-new-tags/">List of HTML5 new Tags introduced in 5th revision of HTML</a> appeared first on <a href="https://jharaphula.com">OneStop Shop</a>.</p>
]]></description>
										<content:encoded><![CDATA[<img width="300" height="189" src="https://jharaphula.com/wp-content/uploads/2016/05/html5-browser-300x189.png" class="webfeedsFeaturedVisual wp-post-image" alt="List of HTML5 new Tags introduced in 5th revision of HTML" style="display: block; margin-bottom: 10px; clear: both; max-width: 100%;" decoding="async" loading="lazy" srcset="https://jharaphula.com/wp-content/uploads/2016/05/html5-browser-300x189.png 300w, https://jharaphula.com/wp-content/uploads/2016/05/html5-browser.png 750w" sizes="auto, (max-width: 300px) 100vw, 300px" /><p>HTML5 is the 5th Revision of Hypertext Markup Language. By simply adding to our HTML file we can instruct the browser that this file is a HTML5 Document. Compare to older versions of HTML, <a href="https://jharaphula.com/advanced-html5-interview-questions-answers/" target="_blank" rel="noopener noreferrer">HTML5 is rich with many new features</a>. To design a web page more better <strong>HTML5 provides advanced Structural Elements</strong>. In form level HTML5 introduced 3 additional controls. HTML5 introduced several input types. In matter of Graphics &amp; Media elements HTML5 is ultimate. <strong>To draw graphics HTML5 comes with Canvas &amp; SVG</strong>. There are various media elements introduced in HTML5 to make Audio &amp; Video integration easier.</p>
<h2>Types and List of HTML5 new Tags</h2>
<p>In below let us share the List of HTML5 new Tags.</p>
<h2>Structural Tags in HTML5</h2>
<p><span style="color: brown;">header</span> &#8211; While Designing a HTML file header tag helps to define page header in a separate block. Codes related to header pan you can keep inside this tag. Using structural tag is a best practice of HTML5 programmer.</p>
<p><span style="color: brown;">main</span> &#8211; In a HTML document main is the area in between header &amp; footer. Main tag in HTML5 helps to design better structure of a HTML document.</p>
<p><span style="color: brown;">footer</span> &#8211; In a web page HTML footer tag helps to define page footer in a separate block. Codes for site footer panel you can keep inside footer tag. This programming practice makes debugging easier.</p>
<p><span style="color: brown;">nav</span> &#8211; Nav element in HTML5 helps to define navigation links under a single tab. This tag generally we use to create navigation menus in our apps. Using CSS we can optimize nav menus as per the need.</p>
<pre class="brush: xml; title: ; notranslate">&lt;nav&gt;
  &lt;a href=&quot;/photoshop/&quot;&gt;Adobe Photoshop&lt;/a&gt; |
  &lt;a href=&quot;/ajax/&quot;&gt;AJAX&lt;/a&gt; |
  &lt;a href=&quot;/ds/&quot;&gt;Data Structure&lt;/a&gt; |
  &lt;a href=&quot;/python/&quot;&gt;Python&lt;/a&gt; | 
  &lt;a href=&quot;/digitalmarketing/&quot;&gt;Digital Marketing&lt;/a&gt;
&lt;/nav&gt;</pre>
<p><span style="color: brown;">progress</span> &#8211; Progress tab act like an indication. If some job running in background using this control we can show how much work is in progress. It appears in percentage to end-user.</p>
<p><span style="color: brown;">mark</span> &#8211; Mark tag in HTML5 helps to Highlight text easily.</p>
<p><span style="color: brown;">meter</span> &#8211; Meter tag in HTML5 help to present scalar measurement within a known range.</p>
<pre class="brush: xml; title: ; notranslate">&lt;label for=&quot;disk_d&quot;&gt;Disk usage D:&lt;/label&gt;
&lt;meter id=&quot;disk_d&quot; value=&quot;2&quot; min=&quot;0&quot; max=&quot;10&quot;&gt;2/10&lt;/meter&gt;</pre>
<p><span style="color: brown;">dialog</span> &#8211; Using dialog tag we can show popup like window in HTML5. Dialog tag supports Chrome version 37+, Safari 6+ &amp; Opera 24+. Using open property of dialog tag you can show the dialog after page load.</p>
<pre class="brush: xml; title: ; notranslate">&lt;dialog open&gt;This is an open dialog window&lt;/dialog&gt;</pre>
<p><span style="color: brown;">article</span> &#8211; article tag defines an Article in the document. Using article tag we can categorized content area in a HTML file.</p>
<pre class="brush: xml; title: ; notranslate">&lt;article&gt;
&lt;h2&gt;Digital Marketing&lt;/h2&gt;
&lt;p&gt;Digital Marketing comes with SEM, SMM, Blog Commenting, Forum Posting and Link building.&lt;/p&gt;
&lt;/article&gt;</pre>
<p><span style="color: brown;">aside</span> &#8211; aside tag defines content aside from body content. Normally we use this tag to place images or videos aside to text.</p>
<p><span style="color: brown;">bdi</span> &#8211; bdi tag helps to identify text that might be formatted in a different direction from normal text.</p>
<p><span style="color: brown;">time</span> &#8211; time tag helps to specify date &amp; time part in a HTML file.</p>
<pre class="brush: xml; title: ; notranslate">&lt;time datetime=&quot;2009-01-01 20:00&quot;&gt;New Year&lt;/time&gt;</pre>
<p><span style="color: brown;">section</span> &#8211; To identify a particular section in a HTML document section tag is useful.</p>
<p><span style="color: brown;">wbr</span> &#8211; Defines a possible line-break.</p>
<h2>New Form Tags in HTML5</h2>
<p><span style="color: brown;">datalist</span> &#8211; datalist tag helps to declare pre-defined options for HTML Input Control. Using this control you can make your textbox like auto-search option of google. </p>
<p>The `datalist` tag is a powerful yet simple feature that can significantly improve the usability of input forms on your website. By providing a predefined list of options, users can enjoy a more interactive and efficient input experience, akin to the smart search capabilities of major search engines. Whether you&#8217;re developing a small personal project or a large-scale web application, incorporating the `datalist` tag can enhance user satisfaction and streamline form interaction, ultimately leading to a more successful web presence. Embrace this HTML feature and take your forms to the next level!</p>
<p>Example shown below.</p>
<pre class="brush: xml; title: ; notranslate">&lt;input list=&quot;EmployeesName&quot;&gt;
&lt;datalist id=&quot;EmployeesName&quot;&gt;
&lt;option value=&quot;Biswabhusan Panda&quot;&gt;&lt;/option&gt;
&lt;option value=&quot;Raghav Mishra&quot;&gt;&lt;/option&gt;
&lt;option value=&quot;Rupak Srivastab&quot;&gt;&lt;/option&gt;
&lt;option value=&quot;Binay Kumar Panda&quot;&gt;&lt;/option&gt;
&lt;option value=&quot;Sonam Sinha&quot;&gt;
&lt;option value=&quot;Rani Mukharjee&quot;&gt;
&lt;option value=&quot;Muhmmad Abid&quot;&gt;
&lt;option value=&quot;Swapna Roy&quot;&gt;
&lt;option value=&quot;Megha Badajena&quot;&gt;
&lt;/option&gt;&lt;/datalist&gt;</pre>
<p><span style="color: brown;">keygen</span> &#8211; Keygen helps to generate strong Secured key in HTML5. Look at the example below how to use Keygen as a form element in HTML5.</p>
<pre class="brush: xml; title: ; notranslate">&lt;form action=&quot;example_keygen.asp&quot; method=&quot;get&quot;&gt;
Employee Name: &lt;input type=&quot;text&quot; name=&quot;empName&quot;&gt;
Encryption: &lt;keygen name=&quot;passcode&quot;&gt;
&lt;input type=&quot;submit&quot;&gt;
&lt;/form&gt;</pre>
<p><span style="color: brown;">output</span> &#8211; output form element helps to render dynamic result in real-time operation. Example shown below.</p>
<pre class="brush: xml; title: ; notranslate">&lt;form oninput=&quot;outputval.value=parseInt(txtrangle.value)+parseInt(txtnumber.value)&quot;&gt;0
&lt;input type=&quot;range&quot; id=&quot;txtrangle&quot; value=&quot;70&quot;&gt;100 + &lt;input type=&quot;number&quot; id=&quot;txtnumber&quot; value=&quot;50&quot;&gt;= &lt;output name=&quot;outputval&quot; for=&quot;txtrangle txtnumber&quot;&gt;&lt;/output&gt;
&lt;/form&gt;</pre>
<h2>New Input Type Tags in HTML5</h2>
<p>The new input type tags in HTML5 represent a significant step forward in web development. By catering specifically to the needs of user input for various data types, these tags not only streamline the data entry process but also enhance the overall user experience. With HTML5, developers can create forms that are not only functional but also user-friendly, ensuring that websites are both accessible and efficient.</p>
<p>As web standards continue to evolve, embracing these input types will be essential for anyone looking to build modern, responsive web applications that meet user needs effectively. The versatility and convenience provided by HTML5&#8217;s new input types undoubtedly set a new benchmark for form design and data collection in the digital landscape.</p>
<p>Looking into the demand HTML5 comes with many new elements. From a telephone number to date and time all can be handeled using various types of HTML5 input tags. Some of them are preseting below.</p>
<pre class="brush: xml; title: ; notranslate">&lt;input type=&quot;color&quot; id=&quot;txtColor&quot;&gt;
&lt;input type=&quot;date&quot; id=&quot;txtDated&quot;&gt;
&lt;input type=&quot;range&quot; id=&quot;txtRange&quot;&gt;
&lt;input type=&quot;search&quot; id=&quot;txtSearch&quot;&gt;
&lt;input type=&quot;tel&quot; id=&quot;txtTelephone&quot;&gt;
&lt;input type=&quot;datetime&quot; id=&quot;txtDatetime&quot;&gt;
&lt;input type=&quot;datetime-local&quot; id=&quot;txtLocal&quot;&gt;
&lt;input type=&quot;email&quot; id=&quot;txtEmail&quot;&gt;
&lt;input type=&quot;time&quot; id=&quot;txtTime&quot;&gt;
&lt;input type=&quot;url&quot; id=&quot;txtUrl&quot;&gt;
&lt;input type=&quot;week&quot; id=&quot;txtWeek&quot;&gt;
&lt;input type=&quot;month&quot; id=&quot;txtMonth&quot;&gt;
&lt;input type=&quot;number&quot; id=&quot;txtNumber&quot;&gt;</pre>
<h2>HTML5 Graphics Elements</h2>
<p><span style="color: brown;">canvas</span> &#8211; Canvas is a new HTML5 element to draw Graphics using Client Script. Read <a href="https://jharaphula.com/html5-canvas-examples/" target="_blank" rel="noopener noreferrer">more about HTML5 Canvas</a>.</p>
<p>Unlike traditional image formats that are static, the canvas element allows for dynamic rendering of graphics. Developers can manipulate the canvas in real-time, enabling the creation of animated graphics, interactive data visualizations, and engaging games. This dynamic capability is crucial for building applications that require constant updates based on user interactions or data changes.</p>
<p>The canvas API provides a comprehensive suite of functions that enable developers to draw shapes, manipulate colors, and even apply complex transformations. From lines and curves to gradients and patterns, the API is equipped with capabilities that help create intricate designs. Developers can also easily manage images and raster graphics, facilitating extensive visual customization.</p>
<pre class="brush: xml; title: ; notranslate">&lt;canvas id=&quot;demoCanvas&quot;&gt;
Your browser does not support the canvas tag.
&lt;/canvas&gt;

&lt;script&gt;
let canvas = document.getElementById(&quot;demoCanvas&quot;);
let ctx = canvas.getContext(&quot;2d&quot;);
ctx.fillStyle = &quot;#FF6600&quot;;
ctx.fillRect(0, 0, 80, 80);
&lt;/script&gt;</pre>
<p><span style="color: brown;">svg</span> &#8211; HTML5 Supports SVG. svg tag helps to draw graphics using SVG.</p>
<pre class="brush: xml; title: ; notranslate">&lt;svg width=&quot;100&quot; height=&quot;100&quot;&gt;
  &lt;circle cx=&quot;50&quot; cy=&quot;50&quot; r=&quot;40&quot; stroke=&quot;green&quot; stroke-width=&quot;4&quot; fill=&quot;yellow&quot; /&gt;
&lt;/svg&gt;</pre>
<pre></pre>
<h2>Media Elements</h2>
<p><span style="color: brown;">audio</span> &#8211; Using audio tag in HTML5 we can define music. HTML5 Audio tag supports ogg, mpeg audio formats. There are many option using which you can control your audio.</p>
<pre class="brush: xml; title: ; notranslate">&lt;audio src=&quot;jharaphula.wav&quot; controls autoplay&gt;
   Your browser does not support the HTML5 &lt;audio&gt; element.   
&lt;/audio&gt;</pre>
<p><span style="color: brown;">video</span> &#8211; Using video tag in HTML5 we can define movie. HTML5 Video tag supports ogg, mpeg video formats. Starting from play to rewind or forward you have several properties with HTML5 video tag, using which you can implement a video player if needed.</p>
<pre class="brush: xml; title: ; notranslate">&lt;video src = &quot;jharaphula.mp4&quot;  width=&quot;340&quot; height=&quot;220&quot; controls&gt;
   Your browser does not support the HTML5 &lt;video&gt; element.   
&lt;/video&gt;</pre>
<p><span style="color: brown;">embed</span> &#8211; embed tag act like a plugin. Using embed tag we can integrate external application to HTML5 document. embed tag help to integrate youtube videos to our webpages.</p>
<p><span style="color: brown;">source</span> &#8211; source tag helps to declare file path for audio or video elements.</p>
<p><span style="color: brown;">track</span> &#8211; Defines tracks for video &amp; audio.</p>
<h2>drawing graphics on the web</h2>
<p>When it comes to drawing graphics on the web, HTML5 provides two powerful tools: the Canvas API and Scalable Vector Graphics (SVG). Each of these has its own unique strengths, making them suitable for different types of graphic-rendering tasks.</p>
<p>The **Canvas API** is a raster-based approach that allows developers to create dynamic, pixel-based graphics. It provides a flexible and intuitive way to draw shapes, lines, images, and animations directly onto a web page. With JavaScript, developers can write code to manipulate these graphics in real-time, enabling them to create interactive visualizations, games, and captivating user interfaces. The Canvas element is especially powerful for applications that require frequent updates, such as gaming or real-time data visualization.</p>
<p>On the other hand, **SVG** caters to vector-based graphics, which are resolution-independent and easily scalable. SVG graphics are defined using XML, allowing developers to create intricate designs that maintain quality regardless of size. This is particularly beneficial for responsive web design since SVG images can adapt seamlessly to different screen sizes.</p>
<h2>Conclusion</h2>
<p>In conclusion, HTML5 represents a significant evolution in web technology. Its introduction of new structural elements, advanced form controls, and robust media capabilities empowers developers to create more engaging and interactive web applications. As the web continues to evolve, embracing the features of HTML5 will be crucial for creating the next generation of websites that are not only functional but also user-friendly.</p>
<p>The post <a href="https://jharaphula.com/list-of-html5-new-tags/">List of HTML5 new Tags introduced in 5th revision of HTML</a> appeared first on <a href="https://jharaphula.com">OneStop Shop</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://jharaphula.com/list-of-html5-new-tags/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			<media:content url="https://jharaphula.com/wp-content/uploads/2016/05/html5-browser.png" medium="image" />
	</item>
		<item>
		<title>How to drawimage on HTML5 Canvas using Scripting?</title>
		<link>https://jharaphula.com/drawimage-on-html5-canvas/</link>
					<comments>https://jharaphula.com/drawimage-on-html5-canvas/#respond</comments>
		
		<dc:creator><![CDATA[Biswabhusan Panda]]></dc:creator>
		<pubDate>Tue, 10 May 2016 16:47:07 +0000</pubDate>
				<category><![CDATA[Learn HTML5 with Examples]]></category>
		<category><![CDATA[Canvas in HTML5]]></category>
		<category><![CDATA[HTML5 Canvas]]></category>
		<category><![CDATA[Two-dimensional Grid]]></category>
		<guid isPermaLink="false">http://box.jharaphula.com/?p=170</guid>

					<description><![CDATA[<img width="300" height="175" src="https://jharaphula.com/wp-content/uploads/2016/05/HTML5-How-to-Draw-Shapes-on-Canvas-300x175.jpg" class="webfeedsFeaturedVisual wp-post-image" alt="How to drawimage on HTML5 Canvas using Scripting?" style="display: block; margin-bottom: 10px; clear: both; max-width: 100%;" decoding="async" loading="lazy" srcset="https://jharaphula.com/wp-content/uploads/2016/05/HTML5-How-to-Draw-Shapes-on-Canvas-300x175.jpg 300w, https://jharaphula.com/wp-content/uploads/2016/05/HTML5-How-to-Draw-Shapes-on-Canvas.jpg 750w" sizes="auto, (max-width: 300px) 100vw, 300px" /><p>In HTML5 Canvas is a newly introduced tag which consists of width &#38; height attributes. It is specially designed to handle Graphics in HTML5. Canvas...</p>
<p>The post <a href="https://jharaphula.com/drawimage-on-html5-canvas/">How to drawimage on HTML5 Canvas using Scripting?</a> appeared first on <a href="https://jharaphula.com">OneStop Shop</a>.</p>
]]></description>
										<content:encoded><![CDATA[<img width="300" height="175" src="https://jharaphula.com/wp-content/uploads/2016/05/HTML5-How-to-Draw-Shapes-on-Canvas-300x175.jpg" class="webfeedsFeaturedVisual wp-post-image" alt="How to drawimage on HTML5 Canvas using Scripting?" style="display: block; margin-bottom: 10px; clear: both; max-width: 100%;" decoding="async" loading="lazy" srcset="https://jharaphula.com/wp-content/uploads/2016/05/HTML5-How-to-Draw-Shapes-on-Canvas-300x175.jpg 300w, https://jharaphula.com/wp-content/uploads/2016/05/HTML5-How-to-Draw-Shapes-on-Canvas.jpg 750w" sizes="auto, (max-width: 300px) 100vw, 300px" /><p>In HTML5 Canvas is a newly introduced tag which consists of width &amp; height attributes. It is specially designed to handle Graphics in HTML5. <strong>Canvas is a two-dimensional grid</strong>. We can draw graphs, animations, games &amp; many other graphical shapes using JavaScript (<em>Or any Client Side Scripts</em>) on a Canvas. Canvas is the next generation of SVG. <strong>SVG supports vector based graphics where Canvas supports raster based graphics</strong>. SVG supports event handler while Canvas doesn&#8217;t supports event handling. Compare to SVG Canvas is less text rendering capability. Canvas renders pixel by pixel. Once we a draw a graphics in Canvas browser forget this. If we want to change or update some thing to the existing graphics on the canvas we need to re-draw the graphics once again.</p>
<h3>How to declare a Canvas in HTML5?</h3>
<p>Assume in your HTML page you want to draw a graph for area 300 x 250. In this case you can declare a canvas in HTML body part with width 300px &amp; height 250px. Look at the sample below how to declare canvas element in a html document. Always practice to write &#8220;Your browser does not support <a href="https://jharaphula.com/list-of-html5-new-tags/" rel="noopener noreferrer" target="_blank">HTML5</a> Canvas.&#8221; in between the canvas tag. This message will show if your browser not supports canvas.</p>
<pre class="brush: xml; title: ; notranslate">&lt;canvas id=&quot;mycanvas&quot; width=&quot;300&quot; height=&quot;250&quot;&gt;
Your browser does not support HTML5 Canvas.
&lt;/canvas&gt;</pre>
<h3>How to Draw a rectangle?</h3>
<p>As we discussed above we can draw graphics on canvas using client scripts (JavaScript or Jquery). In the below example I used JavaScript to draw a rectangle. Here &#8220;mycanvas&#8221; is the id of HTML5 Canvas control. Using document object model (DOM) getElementById() method I am fetching the canvas control to my JavaScript code. Then using getContext(&#8216;2d&#8217;) I am instructing my Canvas to draw 2D Graphs. To create a rectangle I used fillRect() method. Which <strong>accepts 4 parameters as x1, y1 &amp; x2, y2 as the rectangle areas</strong>. To fill color to my Rectangle I am using fillStyle() method.</p>
<pre class="brush: jscript; title: ; notranslate">var mycanvas = document.getElementById('mycanvas');
var context = mycanvas.getContext('2d');
context.fillStyle = 'blue';
context.fillRect(20, 20, 80, 80);</pre>
<p>While drawing graphics on a html page if required you can have multiple &lt;canvas&gt; elements in a single HTML5 page. Using different ids you can render each individual canvas from Client Scripts.</p>
<h3>How to Draw a line?</h3>
<p>In the below example I am drawing a line from the point 0, 0 to 200, 100. The method I used to draw the line is lineTo(x, y). Like the above here c is a JavaScript variable which holds the Canvas. Using getContext(&#8216;2d&#8217;) I am instructing the canvas to draw 2d graphs. Here line is a 2d graph. <strong>To draw the line initially I set my starting point using moveTo() method. Then applying lineTo() method.</strong> This mean from 0,0 to 200, 100 line will draw.</p>
<pre class="brush: jscript; title: ; notranslate">var c = document.getElementById(&quot;mycanvas&quot;);
var ctx = c.getContext(&quot;2d&quot;);
ctx.moveTo(0,0);
ctx.lineTo(200,100);
ctx.stroke();</pre>
<h3>How to Draw a Circle?</h3>
<p>To draw a circle using HTML5 Canvas element look at the below example. Here I used Arc() method to draw a circle. HTML5 Canvas Arc() method accepts 6 parameters. Initial 2 parameters are for x &amp; y axis. Third parameter is the radius of Arc. From the below code 0 &amp; 2*Math.PI are the starting &amp; ending angles. Last parameter of a Arc() method is a optional parameter. This param says is the Arc is clockwise or anti-clock wise. This parameter accepts Boolean values. </p>
<pre class="brush: jscript; title: ; notranslate">var c = document.getElementById(&quot;mycanvas&quot;);
var ctx = c.getContext(&quot;2d&quot;);
ctx.beginPath();
ctx.arc(95, 50, 40, 0, 2*Math.PI, true);
ctx.stroke();</pre>
<h3>How to print text using HTML5 Canvas?</h3>
<p>To draw a text or label using HTML5 Canvas here I used fillText() method. Using font we can set style for our text. In the below example I declared font as &#8220;20px Arial&#8221;. It means while rendering font-size will show 20px &amp; the font-family is Arial. <strong>FillText() method accepts 3 parameters</strong>. First one is the text string, I mean which text you want to display on your canvas. Then the 2nd &amp; 3rd parameters says the position of text on Canvas.</p>
<pre class="brush: jscript; title: ; notranslate">var c = document.getElementById(&quot;mycanvas&quot;);
var ctx = c.getContext(&quot;2d&quot;);
ctx.font = &quot;20px Arial&quot;;
ctx.fillText(&quot;Your Name&quot;,20,90);</pre>
<p>The post <a href="https://jharaphula.com/drawimage-on-html5-canvas/">How to drawimage on HTML5 Canvas using Scripting?</a> appeared first on <a href="https://jharaphula.com">OneStop Shop</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://jharaphula.com/drawimage-on-html5-canvas/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			<media:content url="https://jharaphula.com/wp-content/uploads/2016/05/HTML5-How-to-Draw-Shapes-on-Canvas.jpg" medium="image" />
	</item>
	</channel>
</rss>
