<?xml version="1.0" encoding="UTF-8" standalone="no"?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns="http://www.w3.org/2005/Atom" xmlns:blogger="http://schemas.google.com/blogger/2008" xmlns:gd="http://schemas.google.com/g/2005" xmlns:georss="http://www.georss.org/georss" xmlns:openSearch="http://a9.com/-/spec/opensearchrss/1.0/" xmlns:thr="http://purl.org/syndication/thread/1.0"><id>tag:blogger.com,1999:blog-1532203728703326217</id><updated>2026-10-20T11:27:26.132+02:00</updated><title type="text">Javascript</title><subtitle type="html"/><link href="http://informativejavascript.blogspot.com/feeds/posts/default" rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml"/><link href="http://www.blogger.com/feeds/1532203728703326217/posts/default?redirect=false" rel="self" type="application/atom+xml"/><link href="http://informativejavascript.blogspot.com/" rel="alternate" type="text/html"/><link href="http://pubsubhubbub.appspot.com/" rel="hub"/><author><name>Explore</name><uri>http://www.blogger.com/profile/00425180922796668253</uri><email>noreply@blogger.com</email><gd:image height="24" rel="http://schemas.google.com/g/2005#thumbnail" src="//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjMrE7xcsG1gVp9rcGfxNPY1RIPaQ8xUWR-WpmD8iOnDWPD4GhtK788omXSaZafPiy1njw9lYSLUbpmNG6e7DOBkqiWdxFF4vMIVvdRuejAJ4yBERHcF6WbegNnfNbkQA/s1600/*" width="32"/></author><generator uri="http://www.blogger.com" version="7.00">Blogger</generator><openSearch:totalResults>15</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><xhtml:meta content="noindex" name="robots" xmlns:xhtml="http://www.w3.org/1999/xhtml"/><entry><id>tag:blogger.com,1999:blog-1532203728703326217.post-5890968937544237797</id><published>2013-08-21T13:45:00.003+02:00</published><updated>2013-08-21T16:29:01.604+02:00</updated><title type="text">Lightbox plugin</title><content type="html">&lt;!DOCTYPE html&gt;
&lt;head&gt;
&lt;title&gt; LightBox&lt;/title&gt;
&lt;meta name="robots" content="index" /&gt;
&lt;meta name="description" content="lightbox plugin" /&gt;
&lt;script type="text/javascript"&gt;

  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-37344844-1']);
  _gaq.push(['_setDomainName', 'informativejavascript.blogspot.nl']);
  _gaq.push(['_setAllowLinker', true]);
  _gaq.push(['_trackPageview']);

  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://' : 'http://') + 'stats.g.doubleclick.net/dc.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();

&lt;/script&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
How to implement a basic lightbox plugin, follow the below steps.&lt;br /&gt;
&lt;br /&gt;
1. Import the 3 files by clicking on the links and save them in a forlder and make a note of the path.&lt;br /&gt;
&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;&lt;a href="https://github.com/lokesh/lightbox2/blob/master/js/jquery-1.10.2.min.js"&gt;jquery-1.10.2.min.js&lt;/a&gt;&lt;br /&gt;
&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;&lt;a href="https://github.com/lokesh/lightbox2/blob/master/js/lightbox.js"&gt;lightbox.js&lt;/a&gt;&lt;br /&gt;
&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;&lt;a href="https://github.com/informativejavascript/informative-javascript/blob/master/lightbox.css"&gt;lightbox.css&lt;/a&gt;&lt;br /&gt;
&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;&lt;br /&gt;
2. Save the below images&lt;br /&gt;
&amp;nbsp; &amp;nbsp;&lt;a href="https://github.com/lokesh/lightbox2/blob/master/img/demopage/image-3.jpg"&gt;image-1.jpg&lt;/a&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp;&lt;a href="https://github.com/lokesh/lightbox2/blob/master/img/demopage/image-4.jpg"&gt;image-2.jpg&lt;/a&gt;&lt;br /&gt;
&lt;span style="text-align: left;"&gt;&amp;nbsp; &amp;nbsp;&lt;a href="https://github.com/lokesh/lightbox2/blob/master/img/demopage/image-4.jpg" style="text-align: center;"&gt;overlay.png&lt;/a&gt;&amp;nbsp;(download the image shown below)&lt;/span&gt;&lt;br /&gt;
&lt;span style="text-align: left;"&gt;&lt;br /&gt;&lt;/span&gt;
&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgjgCBm6SJ4Bfw0Wy07LQGdOPwqlm-5VmWNGLV4zUhqGWIiSywIU2znrAJuXM7IKvDMQZIN0hLzL0w9FiIbY8VQfLtutJ-J5V2B1_vyTj7m3JlnpjtD-kwi6PhT3sPsA5pXRxSv_5Hsg7s/s1600/overlay.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgjgCBm6SJ4Bfw0Wy07LQGdOPwqlm-5VmWNGLV4zUhqGWIiSywIU2znrAJuXM7IKvDMQZIN0hLzL0w9FiIbY8VQfLtutJ-J5V2B1_vyTj7m3JlnpjtD-kwi6PhT3sPsA5pXRxSv_5Hsg7s/s1600/overlay.png" /&gt;&lt;/a&gt;&lt;span style="text-align: left;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. Now implement all the above resources into your HTML source as shown below.&lt;br /&gt;
&lt;br /&gt;
&lt;span style="color: #3d85c6;"&gt;&amp;lt;!DOCTYPE html&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #3d85c6;"&gt;&amp;lt;html&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #3d85c6;"&gt;&amp;lt;head&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #3d85c6;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;&amp;lt;title&amp;gt;Lightbox&amp;lt;/title&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #3d85c6;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;&amp;lt;script type="text/javascript" src="&lt;span style="background-color: #f4cccc;"&gt;c:/js/lightbox/js/jquery-1.10.2.min.js&lt;/span&gt;"&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #3d85c6;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;&amp;lt;script type="text/javascript" src="&lt;span style="background-color: #f4cccc;"&gt;c:/js/lightbox/js/lightbox.js&lt;/span&gt;"&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #3d85c6;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;&amp;lt;link rel="stylesheet" type="text/css" href="&lt;span style="background-color: #f4cccc;"&gt;c:/js/lightbox/css/lightbox.css&lt;/span&gt;" media="screen" /&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #3d85c6;"&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #3d85c6;"&gt;&amp;lt;body&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #3d85c6;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;&amp;lt;a href="&lt;span style="background-color: #f4cccc;"&gt;c:/js/lightbox/img/demopage/image-1.jpg&lt;/span&gt;" &lt;span style="background-color: #fff2cc;"&gt;rel="lightbox"&lt;/span&gt; alt="lightbox image" title="You can add text here"&amp;gt; Image 1 &amp;lt;/a&amp;gt; &amp;lt;br&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #3d85c6;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;&amp;lt;a href="&lt;span style="background-color: #f4cccc;"&gt;c:/js/lightbox/img/demopage/image-2.jpg&lt;/span&gt;" &lt;span style="background-color: #fff2cc;"&gt;rel="lightbox"&lt;/span&gt; alt="lightbox image" title="You can add text here"&amp;gt; Image 2 &amp;lt;/a&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #3d85c6;"&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #3d85c6;"&gt;&amp;lt;/html&amp;gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #3d85c6;"&gt;&lt;br /&gt;&lt;/span&gt;
4. section highlighted in red should be replaced by the path you have saved the files and images.&lt;br /&gt;
5. Also note that section highlighted in yellow is&amp;nbsp;mandatory&amp;nbsp;you have to add it.&lt;br /&gt;
6. View the page on the browser and click on the image links.&lt;br /&gt;
&lt;br /&gt;
If you come across with any error message or unable to implement you can leave a comment below and we will get back to you shortly.&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;

&lt;/body&gt;
&lt;/html&gt;</content><link href="http://informativejavascript.blogspot.com/feeds/5890968937544237797/comments/default" rel="replies" title="Post Comments" type="application/atom+xml"/><link href="http://informativejavascript.blogspot.com/2013/08/lightbox-plugin.html#comment-form" rel="replies" title="9 Comments" type="text/html"/><link href="http://www.blogger.com/feeds/1532203728703326217/posts/default/5890968937544237797" rel="edit" type="application/atom+xml"/><link href="http://www.blogger.com/feeds/1532203728703326217/posts/default/5890968937544237797" rel="self" type="application/atom+xml"/><link href="http://informativejavascript.blogspot.com/2013/08/lightbox-plugin.html" rel="alternate" title="Lightbox plugin" type="text/html"/><author><name>Explore</name><uri>http://www.blogger.com/profile/00425180922796668253</uri><email>noreply@blogger.com</email><gd:image height="24" rel="http://schemas.google.com/g/2005#thumbnail" src="//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjMrE7xcsG1gVp9rcGfxNPY1RIPaQ8xUWR-WpmD8iOnDWPD4GhtK788omXSaZafPiy1njw9lYSLUbpmNG6e7DOBkqiWdxFF4vMIVvdRuejAJ4yBERHcF6WbegNnfNbkQA/s1600/*" width="32"/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" height="72" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgjgCBm6SJ4Bfw0Wy07LQGdOPwqlm-5VmWNGLV4zUhqGWIiSywIU2znrAJuXM7IKvDMQZIN0hLzL0w9FiIbY8VQfLtutJ-J5V2B1_vyTj7m3JlnpjtD-kwi6PhT3sPsA5pXRxSv_5Hsg7s/s72-c/overlay.png" width="72"/><thr:total>9</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1532203728703326217.post-1798900523394363589</id><published>2013-03-01T15:31:00.003+01:00</published><updated>2013-08-21T16:10:45.279+02:00</updated><title type="text">Jquery animate</title><content type="html">&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
Jquery Animate.&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
A small example to illustrate the animate function.In this example I have used 3 buttons which modifies the fontsize.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
&amp;lt;button class='increase'&amp;gt;Increase&amp;lt;/button&amp;gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;&amp;lt;button class='decrease'&amp;gt;Decrease&amp;lt;/button&amp;gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;&amp;lt;button class='reset'&amp;gt;Reset&amp;lt;/button&amp;gt;&lt;/div&gt;
&lt;div&gt;
&amp;lt;div class="div1"&amp;gt;&lt;/div&gt;
&lt;div&gt;
This is the sample text and now check how the font increases and decreases when clicked on the respective buttons.&lt;/div&gt;
&lt;div&gt;
&amp;lt;br /&amp;gt;&lt;/div&gt;
&lt;div&gt;
&amp;lt;/div&amp;gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
******************script****************&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
$(document).ready(function() {&lt;/div&gt;
&lt;div&gt;
&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;(function display(){&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;  &lt;/span&gt;$('.increase').on('click',function(){&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &lt;span class="Apple-tab-span" style="white-space: pre;"&gt;   &lt;/span&gt;$('div.div1').animate({&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &lt;span class="Apple-tab-span" style="white-space: pre;"&gt;    &lt;/span&gt;fontSize:'+=1'&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &lt;span class="Apple-tab-span" style="white-space: pre;"&gt;    &lt;/span&gt;},100);&lt;/div&gt;
&lt;div&gt;
&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;  &lt;/span&gt;});&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;  &lt;/span&gt;$('.decrease').on('click',function(){&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &lt;span class="Apple-tab-span" style="white-space: pre;"&gt;   &lt;/span&gt;$('div.div1').animate({&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &lt;span class="Apple-tab-span" style="white-space: pre;"&gt;    &lt;/span&gt;fontSize:'-=1'&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &lt;span class="Apple-tab-span" style="white-space: pre;"&gt;    &lt;/span&gt;},100);&lt;/div&gt;
&lt;div&gt;
&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;  &lt;/span&gt;});&lt;/div&gt;
&lt;div&gt;
&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;  &lt;/span&gt;$('.reset').on('click',function(){&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &lt;span class="Apple-tab-span" style="white-space: pre;"&gt;   &lt;/span&gt;$('div.div1').animate({&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &lt;span class="Apple-tab-span" style="white-space: pre;"&gt;    &lt;/span&gt;fontSize:'16'&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &lt;span class="Apple-tab-span" style="white-space: pre;"&gt;    &lt;/span&gt;},100);&lt;/div&gt;
&lt;div&gt;
&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;  &lt;/span&gt;});&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;})();&lt;/div&gt;
&lt;div&gt;
});&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
You can also view the live working example on the below mentioned link.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;a href="http://jsfiddle.net/informativejavascript/9YjTM/5/"&gt;http://jsfiddle.net/informativejavascript/9YjTM/5/&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Similarly you can implement the image resize functionality. I can check the below link for working example&lt;br /&gt;
&lt;br /&gt;
&lt;a href="http://jsfiddle.net/informativejavascript/vENbK/2/"&gt;http://jsfiddle.net/informativejavascript/vENbK/2/&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;script type="text/javascript"&gt;

  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-37344844-1']);
  _gaq.push(['_setDomainName', 'informativejavascript.blogspot.nl']);
  _gaq.push(['_setAllowLinker', true]);
  _gaq.push(['_trackPageview']);

  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://' : 'http://') + 'stats.g.doubleclick.net/dc.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();

&lt;/script&gt;</content><link href="http://informativejavascript.blogspot.com/feeds/1798900523394363589/comments/default" rel="replies" title="Post Comments" type="application/atom+xml"/><link href="http://informativejavascript.blogspot.com/2013/03/jquery-animate.html#comment-form" rel="replies" title="0 Comments" type="text/html"/><link href="http://www.blogger.com/feeds/1532203728703326217/posts/default/1798900523394363589" rel="edit" type="application/atom+xml"/><link href="http://www.blogger.com/feeds/1532203728703326217/posts/default/1798900523394363589" rel="self" type="application/atom+xml"/><link href="http://informativejavascript.blogspot.com/2013/03/jquery-animate.html" rel="alternate" title="Jquery animate" type="text/html"/><author><name>Explore</name><uri>http://www.blogger.com/profile/00425180922796668253</uri><email>noreply@blogger.com</email><gd:image height="24" rel="http://schemas.google.com/g/2005#thumbnail" src="//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjMrE7xcsG1gVp9rcGfxNPY1RIPaQ8xUWR-WpmD8iOnDWPD4GhtK788omXSaZafPiy1njw9lYSLUbpmNG6e7DOBkqiWdxFF4vMIVvdRuejAJ4yBERHcF6WbegNnfNbkQA/s1600/*" width="32"/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1532203728703326217.post-4494007457916535664</id><published>2013-02-24T15:36:00.002+01:00</published><updated>2013-08-21T16:10:35.566+02:00</updated><title type="text">Timer</title><content type="html">&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
Timer using Jquery.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;html&amp;gt;&lt;br /&gt;
&amp;lt;head&amp;gt;&lt;br /&gt;
&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;&amp;lt;title&amp;gt;&amp;lt;/title&amp;gt;&lt;br /&gt;
&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;&amp;lt;script src="http://code.jquery.com/jquery-1.9.0.js"&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/head&amp;gt;&lt;br /&gt;
&amp;lt;body&amp;gt;&lt;br /&gt;
&amp;lt;input ="text" id="i1"/&amp;gt;&lt;br /&gt;
&amp;lt;button id="start"&amp;gt;start&amp;lt;/button&amp;gt;&lt;br /&gt;
&amp;lt;button id="stop"&amp;gt;stop&amp;lt;/button&amp;gt;&lt;br /&gt;
&amp;lt;button id="reset"&amp;gt;reset&amp;lt;/button&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;var counter=0;&lt;br /&gt;
&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;var timer=0;&lt;br /&gt;
$('#start').on('click',function(){&lt;br /&gt;
&amp;nbsp; &amp;nbsp; timer=setInterval(function(){&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;$('#i1').val(++counter);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; },300);&lt;br /&gt;
});&lt;br /&gt;
&lt;br /&gt;
$('#stop').on('click',function(){&lt;br /&gt;
&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;clearInterval(timer);&lt;br /&gt;
&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;});&lt;br /&gt;
&lt;br /&gt;
$('#reset').on('click',function(){&lt;br /&gt;
&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;$('#i1').val(0);&lt;br /&gt;
&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;counter=0;&lt;br /&gt;
&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;});&lt;br /&gt;
&lt;br /&gt;
})();&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/body&amp;gt;&lt;br /&gt;
&amp;lt;/html&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can check the live demo on&amp;nbsp;&lt;a href="http://jsfiddle.net/informativejavascript/AWGD6/9/"&gt;http://jsfiddle.net/informativejavascript/AWGD6/9/&lt;/a&gt;&lt;/div&gt;
&lt;script type="text/javascript"&gt;

  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-37344844-1']);
  _gaq.push(['_setDomainName', 'informativejavascript.blogspot.nl']);
  _gaq.push(['_setAllowLinker', true]);
  _gaq.push(['_trackPageview']);

  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://' : 'http://') + 'stats.g.doubleclick.net/dc.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();

&lt;/script&gt;</content><link href="http://informativejavascript.blogspot.com/feeds/4494007457916535664/comments/default" rel="replies" title="Post Comments" type="application/atom+xml"/><link href="http://informativejavascript.blogspot.com/2013/02/timer.html#comment-form" rel="replies" title="0 Comments" type="text/html"/><link href="http://www.blogger.com/feeds/1532203728703326217/posts/default/4494007457916535664" rel="edit" type="application/atom+xml"/><link href="http://www.blogger.com/feeds/1532203728703326217/posts/default/4494007457916535664" rel="self" type="application/atom+xml"/><link href="http://informativejavascript.blogspot.com/2013/02/timer.html" rel="alternate" title="Timer" type="text/html"/><author><name>Explore</name><uri>http://www.blogger.com/profile/00425180922796668253</uri><email>noreply@blogger.com</email><gd:image height="24" rel="http://schemas.google.com/g/2005#thumbnail" src="//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjMrE7xcsG1gVp9rcGfxNPY1RIPaQ8xUWR-WpmD8iOnDWPD4GhtK788omXSaZafPiy1njw9lYSLUbpmNG6e7DOBkqiWdxFF4vMIVvdRuejAJ4yBERHcF6WbegNnfNbkQA/s1600/*" width="32"/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1532203728703326217.post-7079181669560726634</id><published>2013-01-27T18:12:00.003+01:00</published><updated>2013-08-21T16:10:25.824+02:00</updated><title type="text">Create objects</title><content type="html">&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
&lt;br /&gt;
What is an object&lt;br /&gt;
&amp;nbsp; object is a special kind of data which properties and methods.&lt;br /&gt;
&lt;br /&gt;
We can create objects in multiple ways.&lt;br /&gt;
&lt;br /&gt;
1.&lt;br /&gt;
&lt;span style="color: #6fa8dc;"&gt;var obj1={&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #6fa8dc;"&gt;name:"John",&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #6fa8dc;"&gt;age:20&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #6fa8dc;"&gt;};&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
2.&lt;br /&gt;
&lt;span style="color: #6fa8dc;"&gt;var obj2=new Object();&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #6fa8dc;"&gt;obj2.name="Jim";&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #6fa8dc;"&gt;obj2.age=30;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
How create a object within a object for example create a object(obj3) within (obj1)&lt;br /&gt;
&lt;br /&gt;
&lt;span style="color: #6fa8dc;"&gt;var obj1={&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #6fa8dc;"&gt;name:"John",&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #6fa8dc;"&gt;age:20,&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #6fa8dc;"&gt;obj3={&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #6fa8dc;"&gt;&amp;nbsp;city:"Enschede",&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #6fa8dc;"&gt;country:"The Netherlands"&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #6fa8dc;"&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #6fa8dc;"&gt;};&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
How to access the properties and the values&lt;br /&gt;
&lt;br /&gt;
&lt;span style="color: #6fa8dc;"&gt;console.log(obj1.name);//&lt;/span&gt;&lt;span style="color: #c27ba0;"&gt;output is John&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #6fa8dc;"&gt;console.log(obj1.age);//&lt;/span&gt;&lt;span style="color: #c27ba0;"&gt;20&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #6fa8dc;"&gt;console.log(obj2.name);//&lt;/span&gt;&lt;span style="color: #c27ba0;"&gt;Jim&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #6fa8dc;"&gt;console.log(obj2.name);//&lt;/span&gt;&lt;span style="color: #c27ba0;"&gt;30&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #6fa8dc;"&gt;console.log(obj1.obj3.city);//&lt;/span&gt;&lt;span style="color: #c27ba0;"&gt;Enschede&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #6fa8dc;"&gt;console.log(obj1.obj3.country);//&lt;/span&gt;&lt;span style="color: #c27ba0;"&gt;The Netherlands&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
How to create functions.&lt;br /&gt;
&lt;br /&gt;
Syntax is as below.&lt;br /&gt;
&lt;span style="color: #6fa8dc;"&gt;var functionname=function(){&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #6fa8dc;"&gt;};&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Example&lt;br /&gt;
&lt;br /&gt;
&lt;span style="color: #6fa8dc;"&gt;var display=function(name,age){&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #6fa8dc;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;this.name=name;&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #6fa8dc;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;this.age=age;&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #6fa8dc;"&gt;};&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
&lt;br /&gt;
&lt;span style="color: #6fa8dc;"&gt;function display(name,age){&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #6fa8dc;"&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style="color: #6fa8dc;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;this.name=name;&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #6fa8dc;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;this.age=age;&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #6fa8dc;"&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style="color: #6fa8dc;"&gt;};&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
lets create an example in which different object try to access a single method.&lt;br /&gt;
&lt;br /&gt;
1. create an object.&lt;br /&gt;
&lt;span style="color: #6fa8dc;"&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style="color: #6fa8dc;"&gt;var object1={&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #6fa8dc;"&gt;&amp;nbsp;name:"John",&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #6fa8dc;"&gt;age:30&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #6fa8dc;"&gt;};&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
2. Create the method.&lt;br /&gt;
&lt;br /&gt;
&lt;span style="color: #6fa8dc;"&gt;var method1=function(name,age){&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #6fa8dc;"&gt;&amp;nbsp; &amp;nbsp;this.name=name;&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #6fa8dc;"&gt;&amp;nbsp; &amp;nbsp;this.age=age;&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #6fa8dc;"&gt;};&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
3. Relate the object to the method.&lt;br /&gt;
&lt;br /&gt;
&lt;span style="color: #6fa8dc;"&gt;object1.method1=method1;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
4. check the output.&lt;br /&gt;
&lt;br /&gt;
&lt;span style="color: #6fa8dc;"&gt;console.log(object1.name);//John&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #6fa8dc;"&gt;console.log(object1.age);//30&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #6fa8dc;"&gt;object1.method1("Jason",40);&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #6fa8dc;"&gt;console.log(object1.name);//Jason&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #6fa8dc;"&gt;console.log(object1.age);//40&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
or you can also use this&lt;br /&gt;
&lt;span style="color: #6fa8dc;"&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style="color: #6fa8dc;"&gt;function function1(name,age){&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #6fa8dc;"&gt;&amp;nbsp; this.name=name;&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #6fa8dc;"&gt;&amp;nbsp; this.age=age;&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #6fa8dc;"&gt;};&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style="color: #6fa8dc;"&gt;var obj1=new function1("John",30);&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #6fa8dc;"&gt;var obj2=new function1("Jason",32);&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #6fa8dc;"&gt;console.log(obj1.name);&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #6fa8dc;"&gt;console.log(obj1.age);&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #6fa8dc;"&gt;console.log(obj2.name);&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #6fa8dc;"&gt;console.log(obj2.age);&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Concludes by using this keyword we can use as many objects as possible.&lt;br /&gt;
&lt;br /&gt;
How to add a new property to an object.&lt;br /&gt;
&lt;br /&gt;
consider the below object&lt;br /&gt;
&lt;br /&gt;
&lt;span style="color: #6fa8dc;"&gt;var obj4={&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #6fa8dc;"&gt;&amp;nbsp; &amp;nbsp;name:"Helen",&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #6fa8dc;"&gt;&amp;nbsp; &amp;nbsp;age:35&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #6fa8dc;"&gt;};&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style="color: #6fa8dc;"&gt;obj4.city="london";&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #6fa8dc;"&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style="color: #6fa8dc;"&gt;console.log(obj4.city);//london&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #6fa8dc;"&gt;&lt;br /&gt;&lt;/span&gt;Hope this post was informative, will get back with more updates.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;script type="text/javascript"&gt;

  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-37344844-1']);
  _gaq.push(['_setDomainName', 'informativejavascript.blogspot.nl']);
  _gaq.push(['_setAllowLinker', true]);
  _gaq.push(['_trackPageview']);

  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://' : 'http://') + 'stats.g.doubleclick.net/dc.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();

&lt;/script&gt;</content><link href="http://informativejavascript.blogspot.com/feeds/7079181669560726634/comments/default" rel="replies" title="Post Comments" type="application/atom+xml"/><link href="http://informativejavascript.blogspot.com/2013/01/create-objects.html#comment-form" rel="replies" title="0 Comments" type="text/html"/><link href="http://www.blogger.com/feeds/1532203728703326217/posts/default/7079181669560726634" rel="edit" type="application/atom+xml"/><link href="http://www.blogger.com/feeds/1532203728703326217/posts/default/7079181669560726634" rel="self" type="application/atom+xml"/><link href="http://informativejavascript.blogspot.com/2013/01/create-objects.html" rel="alternate" title="Create objects" type="text/html"/><author><name>Explore</name><uri>http://www.blogger.com/profile/00425180922796668253</uri><email>noreply@blogger.com</email><gd:image height="24" rel="http://schemas.google.com/g/2005#thumbnail" src="//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjMrE7xcsG1gVp9rcGfxNPY1RIPaQ8xUWR-WpmD8iOnDWPD4GhtK788omXSaZafPiy1njw9lYSLUbpmNG6e7DOBkqiWdxFF4vMIVvdRuejAJ4yBERHcF6WbegNnfNbkQA/s1600/*" width="32"/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1532203728703326217.post-3619277124601382995</id><published>2013-01-02T21:52:00.003+01:00</published><updated>2013-08-21T16:10:15.270+02:00</updated><title type="text">Window object</title><content type="html">&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
This post will help you to deal with window, location and history objects.&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
So lets get started.....&lt;br /&gt;
we will see how to open a new window and close the window. I have pasted the the code below and you can also view the live working example regarding the same.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="color: #6fa8dc;"&gt;&amp;lt;input type="button" value="open" onclick="openwin()" /&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="color: #6fa8dc;"&gt;&amp;lt;input type="button" value="close" onclick="closewin()" /&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #6fa8dc;"&gt;&amp;lt;input type="button" value="reload" onclick="reloadwin()" /&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="color: #6fa8dc;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="color: #6fa8dc;"&gt;&amp;lt;script type="text/javascript"&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="color: #6fa8dc;"&gt;function openwin(){&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="color: #6fa8dc;"&gt;&amp;nbsp;x=window.open('http://informativejavascript.blogspot.nl','','width=800px,height=250px');&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="color: #6fa8dc;"&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #6fa8dc;"&gt;function closewin(){&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #6fa8dc;"&gt;window.close(x);&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #6fa8dc;"&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #6fa8dc;"&gt;function relaodwin(){&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #6fa8dc;"&gt;location.reload();&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #6fa8dc;"&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="color: #6fa8dc;"&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #6fa8dc;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
Click on the button to open/close the new window, while reload will reload the page.&lt;/div&gt;
&lt;/div&gt;
&lt;input onclick="openwin()" type="button" value="open" /&gt;
&lt;input onclick="closewin()" type="button" value="close" /&gt;
&lt;input onclick="reloadwin()" type="button" value="reload" /&gt;

&lt;script type="text/javascript"&gt;
function openwin(){
 x=window.open('http://informativejavascript.blogspot.nl','','width=300px,height=300px');
}
function reloadwin(){
location.reload();
}
&lt;/script&gt;&lt;br /&gt;
&lt;br /&gt;
Now moving on to the location object.&lt;br /&gt;
&lt;br /&gt;
We have assign, reload and replace methods, we will use the same window created in the previous section.&lt;br /&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;span style="color: #6fa8dc;"&gt;&amp;lt;input type="button" value="assign" onclick="assignwin()" /&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;span style="color: #6fa8dc;"&gt;&amp;lt;input type="button" value="replace" onclick="replacewin()" /&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;
&lt;span style="color: #6fa8dc;"&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style="color: #6fa8dc;"&gt;&amp;lt;script type="text/javascript"&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #6fa8dc;"&gt;function assignwin(){&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #6fa8dc;"&gt;x.location.assign("http://feeds.feedburner.com/blogspot/Puccab");&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #6fa8dc;"&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #6fa8dc;"&gt;function replacewin(){&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #6fa8dc;"&gt;x.location.assign("http://informativejavascript.blogspot.nl/2013/01/window-object.html");&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #6fa8dc;"&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #6fa8dc;"&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Click on the button to assign/replace a new window&lt;/div&gt;
&lt;/div&gt;
&lt;input onclick="assignwin()" type="button" value="assign" /&gt;
&lt;input onclick="replacewin()" type="button" value="replace" /&gt;

&lt;script type="text/javascript"&gt;
function assignwin(){
x.location.assign("http://feeds.feedburner.com/blogspot/Puccab");
}

function replacewin(){
x.location.assign("http://informativejavascript.blogspot.nl/2013/01/window-object.html");
}
&lt;/script&gt;
&lt;script type="text/javascript"&gt;

  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-37344844-1']);
  _gaq.push(['_setDomainName', 'informativejavascript.blogspot.nl']);
  _gaq.push(['_setAllowLinker', true]);
  _gaq.push(['_trackPageview']);

  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://' : 'http://') + 'stats.g.doubleclick.net/dc.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();

&lt;/script&gt;
&lt;br /&gt;
&lt;br /&gt;
Next is the history object&lt;br /&gt;
&lt;br /&gt;
History object are used to create back,forward button and length property which loads the previous URL's in the history list.&lt;br /&gt;
&lt;span style="color: #6fa8dc;"&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style="color: #6fa8dc;"&gt;&amp;lt;input type="button" value="back" onclick="backwin()" /&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;
&lt;span style="color: #6fa8dc;"&gt;&amp;lt;input type="button" value="forward" onclick="forwardwin()" /&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #6fa8dc;"&gt;&amp;lt;input type="button" value="go" onclick="gowin()" /&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #6fa8dc;"&gt;&amp;lt;input type="button" value="length" onclick="lengthurl()" /&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #6fa8dc;"&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style="color: #6fa8dc;"&gt;&amp;lt;script type="text/javascript"&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #6fa8dc;"&gt;function backwin(){&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #6fa8dc;"&gt;history.back();&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #6fa8dc;"&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #6fa8dc;"&gt;function forwardwin(){&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #6fa8dc;"&gt;history.forward();&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #6fa8dc;"&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #6fa8dc;"&gt;function gowin(){&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #6fa8dc;"&gt;history.go();&lt;/span&gt;&lt;span style="color: #c27ba0;"&gt;//go back 2 pages&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #6fa8dc;"&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #6fa8dc;"&gt;function lengthurl(){&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #6fa8dc;"&gt;alert(history.length);&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #6fa8dc;"&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #6fa8dc;"&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;input onclick="backwin()" type="button" value="back" /&gt;
&lt;input onclick="forwardwin()" type="button" value="forward" /&gt;
&lt;input onclick="gowin()" type="button" value="go" /&gt;&lt;input onclick="lengthurl()" type="button" value="length" /&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;a href="http://feeds.feedburner.com/~r/blogspot/Puccab/~6/2" target="_blank"&gt;&lt;img alt="Informative Javascript" src="http://feeds.feedburner.com/blogspot/Puccab.2.gif" /&gt;&lt;/a&gt;&lt;/div&gt;</content><link href="http://informativejavascript.blogspot.com/feeds/3619277124601382995/comments/default" rel="replies" title="Post Comments" type="application/atom+xml"/><link href="http://informativejavascript.blogspot.com/2013/01/window-object.html#comment-form" rel="replies" title="0 Comments" type="text/html"/><link href="http://www.blogger.com/feeds/1532203728703326217/posts/default/3619277124601382995" rel="edit" type="application/atom+xml"/><link href="http://www.blogger.com/feeds/1532203728703326217/posts/default/3619277124601382995" rel="self" type="application/atom+xml"/><link href="http://informativejavascript.blogspot.com/2013/01/window-object.html" rel="alternate" title="Window object" type="text/html"/><author><name>Explore</name><uri>http://www.blogger.com/profile/00425180922796668253</uri><email>noreply@blogger.com</email><gd:image height="24" rel="http://schemas.google.com/g/2005#thumbnail" src="//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjMrE7xcsG1gVp9rcGfxNPY1RIPaQ8xUWR-WpmD8iOnDWPD4GhtK788omXSaZafPiy1njw9lYSLUbpmNG6e7DOBkqiWdxFF4vMIVvdRuejAJ4yBERHcF6WbegNnfNbkQA/s1600/*" width="32"/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1532203728703326217.post-9039592586335982327</id><published>2013-01-01T19:33:00.001+01:00</published><updated>2013-08-21T16:10:02.479+02:00</updated><title type="text">Timer</title><content type="html">&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
How to set Timer using Javascript.&lt;br /&gt;
&lt;br /&gt;
Below code explains how to set a timer and stop a timer, you will also find a working example regarding the same.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style="color: #6fa8dc;"&gt;&amp;lt;form name="f1"&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #6fa8dc;"&gt;&amp;lt;input type="text" id="but" /&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #6fa8dc;"&gt;&amp;lt;input type="button" value="start" onclick="timer()" name="theButton" /&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #6fa8dc;"&gt;&amp;lt;input type="button" value="stop" onclick="stoptimer()" /&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #6fa8dc;"&gt;&amp;lt;/form&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;
&lt;span style="color: #6fa8dc;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;span style="color: #6fa8dc;"&gt;&amp;lt;script type="text/javascript"&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="color: #6fa8dc;"&gt;var count=0;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="color: #6fa8dc;"&gt;var x;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="color: #6fa8dc;"&gt;function timer(){&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="color: #6fa8dc;"&gt;x=setTimeout("timer()",1000);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="color: #6fa8dc;"&gt;count=count+1;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="color: #6fa8dc;"&gt;document.getElementById("but").value=count;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="color: #6fa8dc;"&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="color: #6fa8dc;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="color: #6fa8dc;"&gt;function stoptimer(){&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="color: #6fa8dc;"&gt;clearTimeout(x);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="color: #6fa8dc;"&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="color: #6fa8dc;"&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
Click the below start and stop button to view the timer.&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;

&lt;form name="f1"&gt;
&lt;input type="text" id="but" /&gt;
&lt;input type="button" value="start" onclick="timer()" name="theButton" /&gt;
&lt;input type="button" value="stop" onclick="stoptimer()" /&gt;
&lt;/form&gt;

&lt;script type="text/javascript"&gt;
var count=0;
var x;
function timer(){
x=setTimeout("timer()",1000);
count=count+1;
document.getElementById("but").value=count;
}

function stoptimer(){
clearTimeout(x);
}
&lt;/script&gt;
&lt;script type="text/javascript"&gt;

  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-37344844-1']);
  _gaq.push(['_setDomainName', 'informativejavascript.blogspot.nl']);
  _gaq.push(['_setAllowLinker', true]);
  _gaq.push(['_trackPageview']);

  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://' : 'http://') + 'stats.g.doubleclick.net/dc.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();

&lt;/script&gt;
&lt;a target="_blank" href="http://feeds.feedburner.com/~r/blogspot/Puccab/~6/2"&gt;&lt;img src="http://feeds.feedburner.com/blogspot/Puccab.2.gif" alt="Informative Javascript"&gt;&lt;/a&gt;

&lt;!-- Conduit mobile app redirect - Begin --&gt;
&lt;script type='text/javascript'&gt;/* &lt;![CDATA[ */var Conduit = window.Conduit || {};Conduit.appUrl = 'http://845bbe5e-1fbe-407b-9e92-ac950a288841.conduitapps.com';/* ]]&gt; */&lt;/script&gt;
&lt;script src='http://mobilecp.conduit.com/expagescripts.ashx?type=redirect' type='text/javascript'&gt;&lt;/script&gt;
&lt;!-- Conduit mobile app redirect - End --&gt;</content><link href="http://informativejavascript.blogspot.com/feeds/9039592586335982327/comments/default" rel="replies" title="Post Comments" type="application/atom+xml"/><link href="http://informativejavascript.blogspot.com/2013/01/timer.html#comment-form" rel="replies" title="0 Comments" type="text/html"/><link href="http://www.blogger.com/feeds/1532203728703326217/posts/default/9039592586335982327" rel="edit" type="application/atom+xml"/><link href="http://www.blogger.com/feeds/1532203728703326217/posts/default/9039592586335982327" rel="self" type="application/atom+xml"/><link href="http://informativejavascript.blogspot.com/2013/01/timer.html" rel="alternate" title="Timer" type="text/html"/><author><name>Explore</name><uri>http://www.blogger.com/profile/00425180922796668253</uri><email>noreply@blogger.com</email><gd:image height="24" rel="http://schemas.google.com/g/2005#thumbnail" src="//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjMrE7xcsG1gVp9rcGfxNPY1RIPaQ8xUWR-WpmD8iOnDWPD4GhtK788omXSaZafPiy1njw9lYSLUbpmNG6e7DOBkqiWdxFF4vMIVvdRuejAJ4yBERHcF6WbegNnfNbkQA/s1600/*" width="32"/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1532203728703326217.post-6465204620943610070</id><published>2012-12-30T21:44:00.002+01:00</published><updated>2013-08-21T16:09:46.272+02:00</updated><title type="text">Tools</title><content type="html">&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
&lt;br /&gt;
How to use Sublime Text 2&lt;br /&gt;
&lt;br /&gt;
I hope you have&amp;nbsp;downloaded&amp;nbsp;the&amp;nbsp;Sublime Text 2&amp;nbsp;from the link&amp;nbsp;mentioned&amp;nbsp;on the previous Page.If not you can use this link to download&amp;nbsp;&lt;a href="http://www.sublimetext.com/2" target="_blank"&gt;Sublime Text 2&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Next download the firebug tool and this is applicable if you are using Firefox browser,&amp;nbsp;once installed open the&amp;nbsp;Firefox&amp;nbsp;browser and press F12. You can use F12 on any of&amp;nbsp;the&amp;nbsp;browser it could be IE or chrome you would get the small window on the bottom of a screen as shown below.&lt;br /&gt;
&lt;br /&gt;
You can use F12 key to on the firebug option and F12 to close the firebug.&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhslJFzVDsP66ihb9U9qqHrApfMERLWJ82KPaYrA1pPZVdFAahH37OQfztObaor3cS-JE0TyjUiA2Xalwcx9VYl7hL95t7LX5IxcT0g_9AleX7_6CEPzOzieWuZhFcanotIofSxGQcdjyI/s1600/firebug.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="255" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhslJFzVDsP66ihb9U9qqHrApfMERLWJ82KPaYrA1pPZVdFAahH37OQfztObaor3cS-JE0TyjUiA2Xalwcx9VYl7hL95t7LX5IxcT0g_9AleX7_6CEPzOzieWuZhFcanotIofSxGQcdjyI/s320/firebug.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To know more on using firebug tool please visit the below link&amp;nbsp;&lt;a href="http://getfirebug.com/whatisfirebug" target="_blank"&gt;How to use firebug&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Hope you found this post informative, Please visit my posts regularly for more details.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;script type="text/javascript"&gt;

  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-37344844-1']);
  _gaq.push(['_setDomainName', 'informativejavascript.blogspot.nl']);
  _gaq.push(['_setAllowLinker', true]);
  _gaq.push(['_trackPageview']);

  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://' : 'http://') + 'stats.g.doubleclick.net/dc.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();

&lt;/script&gt;
&lt;a href="http://feeds.feedburner.com/~r/blogspot/Puccab/~6/2" target="_blank"&gt;&lt;img alt="Informative Javascript" src="http://feeds.feedburner.com/blogspot/Puccab.2.gif" /&gt;&lt;/a&gt;

&lt;!-- Conduit mobile app redirect - Begin --&gt;
&lt;script type="text/javascript"&gt;/* &lt;![CDATA[ */var Conduit = window.Conduit || {};Conduit.appUrl = 'http://845bbe5e-1fbe-407b-9e92-ac950a288841.conduitapps.com';/* ]]&gt; */&lt;/script&gt;
&lt;script src="http://mobilecp.conduit.com/expagescripts.ashx?type=redirect" type="text/javascript"&gt;&lt;/script&gt;
&lt;!-- Conduit mobile app redirect - End --&gt;&lt;/div&gt;</content><link href="http://informativejavascript.blogspot.com/feeds/6465204620943610070/comments/default" rel="replies" title="Post Comments" type="application/atom+xml"/><link href="http://informativejavascript.blogspot.com/2012/12/tools.html#comment-form" rel="replies" title="0 Comments" type="text/html"/><link href="http://www.blogger.com/feeds/1532203728703326217/posts/default/6465204620943610070" rel="edit" type="application/atom+xml"/><link href="http://www.blogger.com/feeds/1532203728703326217/posts/default/6465204620943610070" rel="self" type="application/atom+xml"/><link href="http://informativejavascript.blogspot.com/2012/12/tools.html" rel="alternate" title="Tools" type="text/html"/><author><name>Explore</name><uri>http://www.blogger.com/profile/00425180922796668253</uri><email>noreply@blogger.com</email><gd:image height="24" rel="http://schemas.google.com/g/2005#thumbnail" src="//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjMrE7xcsG1gVp9rcGfxNPY1RIPaQ8xUWR-WpmD8iOnDWPD4GhtK788omXSaZafPiy1njw9lYSLUbpmNG6e7DOBkqiWdxFF4vMIVvdRuejAJ4yBERHcF6WbegNnfNbkQA/s1600/*" width="32"/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" height="72" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhslJFzVDsP66ihb9U9qqHrApfMERLWJ82KPaYrA1pPZVdFAahH37OQfztObaor3cS-JE0TyjUiA2Xalwcx9VYl7hL95t7LX5IxcT0g_9AleX7_6CEPzOzieWuZhFcanotIofSxGQcdjyI/s72-c/firebug.png" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1532203728703326217.post-5459609763872864819</id><published>2012-12-30T14:14:00.002+01:00</published><updated>2013-08-21T16:09:37.749+02:00</updated><title type="text">Cookies</title><content type="html">&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
&lt;span style="font-size: large;"&gt;Javascript Cookies&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Cookie&lt;/b&gt;&lt;br /&gt;
&lt;ul style="text-align: left;"&gt;
&lt;li&gt;&lt;span style="background-color: white; color: #333333; font-family: arial, helvetica, clean, sans-serif; font-size: 13px; line-height: 20px;"&gt;A cookie is a piece of text that &lt;/span&gt;&lt;span style="background-color: white; font-family: arial, helvetica, clean, sans-serif; font-size: 13px; line-height: 20px;"&gt;a&amp;nbsp;&lt;/span&gt;&lt;a href="http://computer.howstuffworks.com/web-server.htm" style="background-color: white; font-family: arial, helvetica, clean, sans-serif; font-size: 13px; line-height: 20px; text-decoration: initial;"&gt;&lt;span style="color: black;"&gt;Web server&lt;/span&gt;&lt;/a&gt;&lt;span style="background-color: white; font-family: arial, helvetica, clean, sans-serif; font-size: 13px; line-height: 20px;"&gt;&amp;nbsp;can store on a user's&amp;nbsp;&lt;/span&gt;&lt;a href="http://computer.howstuffworks.com/hard-disk.htm" style="background-color: white; font-family: arial, helvetica, clean, sans-serif; font-size: 13px; line-height: 20px; text-decoration: initial;"&gt;&lt;span style="color: black;"&gt;hard disk&lt;/span&gt;&lt;/a&gt;&lt;span style="background-color: white; font-family: arial, helvetica, clean, sans-serif; font-size: 13px; line-height: 20px;"&gt;.&lt;/span&gt;&lt;span style="background-color: white; color: #333333; font-family: arial, helvetica, clean, sans-serif; font-size: 13px; line-height: 20px;"&gt; Cookies allow a Web site to store information on a user's machine and later retrieve it.&lt;/span&gt;&lt;span style="background-color: white; color: #333333; font-family: arial, helvetica, clean, sans-serif; font-size: 13px; line-height: 20px;"&gt;For example, a Web site might generate a unique ID number for each visitor and store the ID number on each user's machine using a cookie file.&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;b&gt;when are cookies created.&lt;/b&gt;&lt;br /&gt;
&lt;ul style="text-align: left;"&gt;
&lt;li&gt;when you load a webpage,click on ads, submit forms.&lt;/li&gt;
&lt;/ul&gt;
&lt;b&gt;what does the text file consists of&lt;/b&gt;&lt;br /&gt;
&lt;ul style="text-align: left;"&gt;
&lt;li&gt;name-value pair containing the actual data&lt;/li&gt;
&lt;li&gt;expiry&amp;nbsp;date&lt;/li&gt;
&lt;li&gt;path and domain of the server to which the cookie details should be sent to.&lt;/li&gt;
&lt;/ul&gt;
&lt;div&gt;
Sample cookie file&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&lt;pre style="background-color: white; color: #333333; font-size: 13px; line-height: 13px; margin-top: 15px; padding: 0px;"&gt;UserID    A9A3BECE0563982D    www.goto.com/&lt;/pre&gt;
&lt;pre style="background-color: white; margin-top: 15px; padding: 0px;"&gt;&lt;ul style="text-align: left;"&gt;
&lt;li&gt;&lt;span style="color: #333333; font-family: Times, Times New Roman, serif;"&gt;&lt;span style="line-height: 13px;"&gt;It is possible to retrieve other cookie information stored on the user's system.&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/pre&gt;
&lt;/div&gt;
&lt;b&gt;Types of cookie&lt;/b&gt;&lt;br /&gt;
&lt;ul style="background-color: white; color: #333333; line-height: 18px; margin: 1.5em 0px; padding: 0px; position: relative; text-decoration: inherit; z-index: 0;"&gt;
&lt;li style="font-style: inherit; list-style-type: disc; margin: 0px 0px 0px 18px; padding: 0px; text-decoration: inherit;"&gt;&lt;span style="font-family: Times, Times New Roman, serif;"&gt;Firt Party Cookies&amp;nbsp;are written by your site and can only be read by your site.&lt;/span&gt;&lt;/li&gt;
&lt;li style="font-style: inherit; list-style-type: disc; margin: 0px 0px 0px 18px; padding: 0px; text-decoration: inherit;"&gt;&lt;span style="font-family: Times, Times New Roman, serif;"&gt;Third Party Cookies&amp;nbsp;are created by advertising in your page that is loaded from a third party site. These can only be read by the advertising code on any site displaying the same ads.&lt;/span&gt;&lt;/li&gt;
&lt;li style="font-style: inherit; list-style-type: disc; margin: 0px 0px 0px 18px; padding: 0px; text-decoration: inherit;"&gt;&lt;span style="font-family: Times, Times New Roman, serif;"&gt;Session Cookies&amp;nbsp;are not actually written to a file but are stored in the browser itself. These cookies only last as long as the browser is open.&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;span style="font-family: Times, Times New Roman, serif;"&gt;&lt;b&gt;what are the steps involved in cookie creation&lt;/b&gt;.&lt;/span&gt;&lt;br /&gt;
&lt;ul style="background-color: white; line-height: 20px; margin: 15px 0px 0px; padding: 0px;"&gt;
&lt;li style="list-style: disc inside; margin: 5px 0px; padding: 0px;"&gt;&lt;span style="font-family: Times, Times New Roman, serif;"&gt;If you type the URL of a Web site into your browser, your browser sends a request to the Web site for the page &amp;nbsp;For example, if you type the URL&amp;nbsp;&lt;span style="font-style: inherit;"&gt;http://www.google.com&lt;/span&gt;&amp;nbsp;into your browser, your browser will contact Google's server and request its home page.&lt;/span&gt;&lt;/li&gt;
&lt;li style="list-style: disc inside; margin: 5px 0px; padding: 0px;"&gt;&lt;span style="font-family: Times, Times New Roman, serif;"&gt;When the browser does this, it will look on your machine for a cookie file that google has set. If it finds an Google cookie file, your browser will send all of the name-value pairs in the file to google's server along with the URL. If it finds no cookie file, it will send no cookie data.&lt;/span&gt;&lt;/li&gt;
&lt;li style="list-style: disc inside; margin: 5px 0px; padding: 0px;"&gt;&lt;span style="font-family: Times, Times New Roman, serif;"&gt;Google's Web server receives the cookie data and the request for a page. If name-value pairs are received, Google can use them.&lt;/span&gt;&lt;/li&gt;
&lt;li style="list-style: disc inside; margin: 5px 0px; padding: 0px;"&gt;&lt;span style="font-family: Times, Times New Roman, serif;"&gt;If no name-value pairs are received, Google knows that you have not visited before. The server creates a new ID for you in Google's database and then sends name-value pairs to your machine in the header for the&amp;nbsp;&lt;a href="http://computer.howstuffworks.com/web-page.htm" style="text-decoration: initial;"&gt;&lt;span style="color: black;"&gt;Web page&lt;/span&gt;&lt;/a&gt;&amp;nbsp;it sends. Your machine stores the name-value pairs on your hard disk.&lt;/span&gt;&lt;/li&gt;
&lt;li style="list-style: disc inside; margin: 5px 0px; padding: 0px;"&gt;&lt;span style="font-family: Times, Times New Roman, serif;"&gt;The Web server can change name-value pairs or add new pairs whenever you visit the site and request a page.&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;div style="background-color: white; line-height: 20px; margin-top: 15px; padding: 0px;"&gt;
&lt;span style="font-family: Times, Times New Roman, serif;"&gt;There are other pieces of information that the server can send with the name-value pair. One of these is an&lt;span style="font-style: inherit;"&gt;expiration date&lt;/span&gt;. Another is a&amp;nbsp;&lt;span style="font-style: inherit;"&gt;path&lt;/span&gt;&amp;nbsp;(so that the site can associate different cookie values with different parts of the site).&lt;/span&gt;&lt;/div&gt;
&lt;div style="background-color: white; line-height: 20px; margin-top: 15px; padding: 0px;"&gt;
&lt;span style="font-family: Times, Times New Roman, serif;"&gt;&lt;b&gt;How are cookies useful?&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style="background-color: white; line-height: 20px; margin-top: 15px; padding: 0px;"&gt;
&lt;/div&gt;
&lt;ul style="text-align: left;"&gt;
&lt;li&gt;&lt;span style="font-family: Times, Times New Roman, serif;"&gt;Track the number of site visitors&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;div style="background-color: white; line-height: 20px; margin-top: 15px; padding: 0px;"&gt;
&lt;span style="font-family: Times, Times New Roman, serif;"&gt;Sites can&amp;nbsp;accurately determine how many people actually visit the site.&amp;nbsp;the only way for a site to accurately count visitors is to set a cookie with a unique ID for each visitor. Using cookies, sites can determine how many visitors arrive, how many are new versus repeat visitors and how often a visitor has visited.&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div style="background-color: white; margin-top: 15px; padding: 0px;"&gt;
&lt;/div&gt;
&lt;ul style="text-align: left;"&gt;
&lt;li&gt;&lt;span style="font-family: Times, Times New Roman, serif;"&gt;&lt;span style="line-height: 20px;"&gt;&lt;span style="background-color: white;"&gt;customization&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;div&gt;
&lt;span style="font-family: Times, Times New Roman, serif;"&gt;&lt;span style="background-color: white; line-height: 20px;"&gt;For example, if you visit&amp;nbsp;&lt;/span&gt;&lt;span style="background-color: white; line-height: 20px;"&gt;msn.com&lt;/span&gt;&lt;span style="background-color: white; line-height: 20px;"&gt;, it offers you the ability to "change content/layout/color." It also allows you to enter your zip code and get customized weather information.&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;ul style="text-align: left;"&gt;
&lt;li&gt;&lt;span style="font-family: Times, Times New Roman, serif;"&gt;&lt;a href="http://money.howstuffworks.com/ecommerce.htm" style="background-color: white; line-height: 20px; text-decoration: initial;"&gt;&lt;span style="color: black;"&gt;E-commerce sites&lt;/span&gt;&lt;/a&gt;&lt;span style="background-color: white; line-height: 20px;"&gt;&amp;nbsp;can implement things like&amp;nbsp;&lt;/span&gt;&lt;span style="background-color: white; line-height: 20px;"&gt;shopping carts&lt;/span&gt;&lt;span style="background-color: white; line-height: 20px;"&gt;&amp;nbsp;and&amp;nbsp;&lt;/span&gt;&lt;span style="background-color: white; line-height: 20px;"&gt;"quick checkout" options&lt;/span&gt;&lt;span style="background-color: white; line-height: 20px;"&gt;.&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;span style="background-color: white; font-family: arial, helvetica, clean, sans-serif; font-size: 13px; line-height: 20px;"&gt;&lt;b&gt;How to create a cookie using javascript.&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;ol style="text-align: left;"&gt;
&lt;li&gt;Create the front end to capture the cookie value.&lt;/li&gt;
&lt;/ol&gt;
&lt;div&gt;
&lt;div&gt;
&lt;span style="color: #6fa8dc; font-family: Times, Times New Roman, serif;"&gt;&amp;lt;form name="f1"&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="color: #6fa8dc; font-family: Times, Times New Roman, serif;"&gt;Enter the cookie value&amp;lt;input type="text" name="cookievalue" /&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="color: #6fa8dc; font-family: Times, Times New Roman, serif;"&gt;&amp;lt;input type="button" value="create cookie1" onclick="createcookie('cookie1')" /&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;span style="color: #6fa8dc; font-family: Times, 'Times New Roman', serif;"&gt;&amp;lt;form&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: Times, 'Times New Roman', serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: Times, 'Times New Roman', serif;"&gt;&amp;nbsp; &amp;nbsp; 2. now create the function createcookie.&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="background-color: white; line-height: 20px;"&gt;&lt;span style="color: #6fa8dc; font-family: Times, Times New Roman, serif;"&gt;function createcookie(name){&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: Times, Times New Roman, serif;"&gt;&lt;span style="background-color: white; line-height: 20px;"&gt;&lt;span style="color: #6fa8dc;"&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;
&lt;span style="background-color: white; line-height: 20px;"&gt;&lt;span style="color: #6fa8dc; font-family: Times, Times New Roman, serif;"&gt;&amp;nbsp; var x=document.f1.cookievalue.value;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span style="font-family: Times, Times New Roman, serif;"&gt;&lt;span style="background-color: white; line-height: 20px;"&gt;
&lt;/span&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;
&lt;span style="background-color: white; line-height: 20px;"&gt;&lt;span style="color: #6fa8dc; font-family: Times, Times New Roman, serif;"&gt;&amp;nbsp; if(!x){&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span style="background-color: white; line-height: 20px;"&gt;&lt;span style="font-family: Times, Times New Roman, serif;"&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;span style="background-color: white; line-height: 20px;"&gt;&lt;span style="color: #6fa8dc; font-family: Times, Times New Roman, serif;"&gt;&amp;nbsp; alert("enter values");&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span style="background-color: white; line-height: 20px;"&gt;&lt;span style="font-family: Times, Times New Roman, serif;"&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;span style="background-color: white; line-height: 20px;"&gt;&lt;span style="color: #6fa8dc; font-family: Times, Times New Roman, serif;"&gt;&amp;nbsp; }&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span style="background-color: white; line-height: 20px;"&gt;
&lt;/span&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;span style="background-color: white; line-height: 20px;"&gt;&lt;span style="color: #6fa8dc; font-family: Times, Times New Roman, serif;"&gt;&amp;nbsp; else{&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span style="background-color: white; line-height: 20px;"&gt;
&lt;/span&gt;
&lt;div&gt;
&lt;span style="background-color: white; line-height: 20px;"&gt;&lt;span style="color: #6fa8dc; font-family: Times, Times New Roman, serif;"&gt;&amp;nbsp; callcookie(name,x,2); // created cookie for 2 days&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span style="background-color: white; line-height: 20px;"&gt;
&lt;div&gt;
&lt;span style="color: #6fa8dc; font-family: Times, Times New Roman, serif;"&gt;&amp;nbsp; alert('cookie created');&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="color: #6fa8dc; font-family: Times, Times New Roman, serif;"&gt;&amp;nbsp; }&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="color: #6fa8dc; font-family: Times, Times New Roman, serif;"&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="font-family: arial, helvetica, clean, sans-serif; font-size: small;"&gt;
3. Create function call cookie which is the main cookie creation;&lt;/div&gt;
&lt;div style="font-family: arial, helvetica, clean, sans-serif; font-size: small;"&gt;
&amp;nbsp;&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&lt;span style="background-color: transparent; color: #6fa8dc; font-family: Times, Times New Roman, serif;"&gt;function callcookie(name,value,days){&lt;/span&gt;&lt;/div&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;span style="color: #6fa8dc; font-family: Times, Times New Roman, serif;"&gt;&amp;nbsp;if(days){&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="color: #6fa8dc; font-family: Times, Times New Roman, serif;"&gt;&amp;nbsp; var d=new Date();&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="color: #6fa8dc; font-family: Times, Times New Roman, serif;"&gt;&amp;nbsp; d.setTime(d.getTime()+(days*24*60*60*1000));&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="color: #6fa8dc; font-family: Times, Times New Roman, serif;"&gt;&amp;nbsp; var expires = "; expires="+d.toGMTString();&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="color: #6fa8dc; font-family: Times, Times New Roman, serif;"&gt;&amp;nbsp; }&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="color: #6fa8dc; font-family: Times, Times New Roman, serif;"&gt;&amp;nbsp; else var expires = "";&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="color: #6fa8dc; font-family: Times, Times New Roman, serif;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;document.cookie = name+"="+value+expires+"; path=/";&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="color: #6fa8dc; font-family: Times, Times New Roman, serif;"&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
4. Now we have created the cookie, its time to read the created cookie&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
create a button or s link so that we can call the function readcookie&lt;/div&gt;
&lt;div&gt;
&lt;span style="color: #6fa8dc;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="color: #6fa8dc;"&gt;&amp;lt;input type="button" value="read cookie" onclick="readcookie('cookie1')" /&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
5. Create the function readcookie&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;span style="color: #6fa8dc;"&gt;function readcookie(name){&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="color: #6fa8dc;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="color: #6fa8dc;"&gt;var allcookie=document.cookie;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="color: #6fa8dc;"&gt;var cookiesplit=allcookie.split(';');&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="color: #6fa8dc;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="color: #6fa8dc;"&gt;for(var i=0;i&amp;lt;cookiesplit.length;i++){&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="color: #6fa8dc;"&gt;&amp;nbsp; &amp;nbsp;name=cookiesplit[i].split("=")[0];&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="color: #6fa8dc;"&gt;&amp;nbsp; &amp;nbsp;value=cookiesplit[i].split("=")[1];&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="color: #6fa8dc;"&gt;&amp;nbsp; &amp;nbsp;alert("cookie is : " + name + " and Value is : " + value);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="color: #6fa8dc;"&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="color: #6fa8dc;"&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
6. Delete/clear the Cookie.&lt;/div&gt;
&lt;div&gt;
&lt;span style="color: #6fa8dc;"&gt;&amp;lt;input type="button" value="delete cookie1" onclick="eraseCookie('cookie1')" /&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
7. Create the function eraseCookie&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;span style="color: #6fa8dc;"&gt;function eraseCookie(name) {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="color: #6fa8dc;"&gt;&lt;span style="white-space: pre;"&gt;callcookie&lt;/span&gt;(name,"",-1);//by setting day to -1 it clears the cookie&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="color: #6fa8dc;"&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #6fa8dc;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
you can check the cookie creation by entering the value in the below text field.&lt;/div&gt;
&lt;br /&gt;
&lt;form name="f1"&gt;
Enter the cookie value&lt;input name="cookievalue" type="text" /&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;input onclick="createcookie('cookie1')" type="button" value="create cookie1" /&gt;
&lt;input onclick="readcookie('cookie1')" type="button" value="read cookie1" /&gt;
&lt;input onclick="eraseCookie('cookie1')" type="button" value="delete cookie1" /&gt;
&lt;/form&gt;
&lt;script type="text/javascript"&gt;
function createcookie(name){

  var x=document.f1.cookievalue.value;
  if(!x){
  alert("enter values");
  }
  else{
  callcookie(name,x,1);
  alert('cookie created');
  }
}

function callcookie(name,value,days){
  if(days){
  var d=new Date();
  d.setTime(d.getTime()+(days*24*60*60*1000));
  var expires = "; expires="+d.toGMTString();
  }
  else var expires = "";
 document.cookie = name+"="+value+expires+"; path=/";
}

function readcookie(name){

var allcookie=document.cookie;
var cookiesplit=allcookie.split(';');

for(var i=0;i&lt;cookiesplit.length;i++){
   name=cookiesplit[i].split("=")[0];
   value=cookiesplit[i].split("=")[1];
   alert("cookie name is : " + name + " and Value is : " + value);
}

}

function eraseCookie(name) {
 callcookie(name,"",-1);
}



  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-37344844-1']);
  _gaq.push(['_setDomainName', 'informativejavascript.blogspot.nl']);
  _gaq.push(['_setAllowLinker', true]);
  _gaq.push(['_trackPageview']);

  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://' : 'http://') + 'stats.g.doubleclick.net/dc.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();


&lt;/script&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;a target="_blank" href="http://feeds.feedburner.com/~r/blogspot/Puccab/~6/2"&gt;&lt;img src="http://feeds.feedburner.com/blogspot/Puccab.2.gif" alt="Informative Javascript"&gt;&lt;/a&gt;
&lt;!-- Conduit mobile app redirect - Begin --&gt;
&lt;script type='text/javascript'&gt;/* &lt;![CDATA[ */var Conduit = window.Conduit || {};Conduit.appUrl = 'http://845bbe5e-1fbe-407b-9e92-ac950a288841.conduitapps.com';/* ]]&gt; */&lt;/script&gt;
&lt;script src='http://mobilecp.conduit.com/expagescripts.ashx?type=redirect' type='text/javascript'&gt;&lt;/script&gt;
&lt;!-- Conduit mobile app redirect - End --&gt;</content><link href="http://informativejavascript.blogspot.com/feeds/5459609763872864819/comments/default" rel="replies" title="Post Comments" type="application/atom+xml"/><link href="http://informativejavascript.blogspot.com/2012/12/cookies.html#comment-form" rel="replies" title="7 Comments" type="text/html"/><link href="http://www.blogger.com/feeds/1532203728703326217/posts/default/5459609763872864819" rel="edit" type="application/atom+xml"/><link href="http://www.blogger.com/feeds/1532203728703326217/posts/default/5459609763872864819" rel="self" type="application/atom+xml"/><link href="http://informativejavascript.blogspot.com/2012/12/cookies.html" rel="alternate" title="Cookies" type="text/html"/><author><name>Explore</name><uri>http://www.blogger.com/profile/00425180922796668253</uri><email>noreply@blogger.com</email><gd:image height="24" rel="http://schemas.google.com/g/2005#thumbnail" src="//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjMrE7xcsG1gVp9rcGfxNPY1RIPaQ8xUWR-WpmD8iOnDWPD4GhtK788omXSaZafPiy1njw9lYSLUbpmNG6e7DOBkqiWdxFF4vMIVvdRuejAJ4yBERHcF6WbegNnfNbkQA/s1600/*" width="32"/></author><thr:total>7</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1532203728703326217.post-6085218735209972143</id><published>2012-12-27T23:39:00.003+01:00</published><updated>2013-01-01T21:56:37.740+01:00</updated><title type="text">Array object</title><content type="html">&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
&lt;span style="font-size: large;"&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style="font-size: large;"&gt;List of array methods&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style="color: #6fa8dc;"&gt;1.toString()&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #6fa8dc;"&gt;2.join()&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #6fa8dc;"&gt;3.sort()&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #6fa8dc;"&gt;4.reverse()&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #6fa8dc;"&gt;5.concat()&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #6fa8dc;"&gt;6.push()&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #6fa8dc;"&gt;7.pop()&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #6fa8dc;"&gt;8.shift()&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #6fa8dc;"&gt;9.unshift()&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #6fa8dc;"&gt;10.slice()&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #6fa8dc;"&gt;11.splice()&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-size: large;"&gt;toString()&lt;/span&gt; is used convert the array element into string&amp;nbsp;separated&amp;nbsp;by comas. for example&lt;br /&gt;
&lt;br /&gt;
&lt;span style="color: #6fa8dc;"&gt;var x=new Array("apples","orange","grapes");&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #6fa8dc;"&gt;document.write(x.toString());&lt;/span&gt; &lt;span style="color: #c27ba0;"&gt;//output is apples,orange,grapes&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-size: large;"&gt;join()&lt;/span&gt; is used to combine each element in the array with given parameter, for example.&lt;br /&gt;
&lt;br /&gt;
&lt;span style="color: #6fa8dc;"&gt;var x=new Array('a','s','d','f','g');&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #6fa8dc;"&gt;document.write(x.join('*'));&lt;/span&gt;//&lt;span style="color: #c27ba0;"&gt;output is a*s*d*f*g&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-size: large;"&gt;sort()&lt;/span&gt; is used to sort the array in ascending order. for example&lt;br /&gt;
&lt;br /&gt;
&lt;span style="color: #6fa8dc;"&gt;var y=new Array('a','s','d','f','g');&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #6fa8dc;"&gt;document.write(y.sort());&lt;/span&gt;&lt;span style="color: #c27ba0;"&gt;//output is a,d,f,g,s&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
consider another example&lt;br /&gt;
&lt;br /&gt;
&lt;span style="color: #6fa8dc;"&gt;var y=new Array(10,30,45,23,78,1,23);&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #6fa8dc;"&gt;document.write(y.sort());&lt;/span&gt;&lt;span style="color: #c27ba0;"&gt;//output would be 1,10,23,23,30,45,78&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
If you consider the same array y and wish to reverse the order hen we cannot use reverse function instead we need to use the below function.&lt;br /&gt;
&lt;br /&gt;
&lt;span style="color: #6fa8dc;"&gt;var y=new Array(10,30,45,23,78,1,23);&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #6fa8dc;"&gt;document.write(y.sort(function(a,b){return b-a;}));&lt;/span&gt;&lt;span style="color: #c27ba0;"&gt;//output would be&amp;nbsp;78,45,30,23,23,10,1&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
For more details refer -&lt;a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Array/sort" target="_blank"&gt;Sort function&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-size: large;"&gt;concat()&lt;/span&gt; is to combine arrays, for example&lt;br /&gt;
&lt;br /&gt;
&lt;span style="color: #6fa8dc;"&gt;var x=new Array(10,20,78,1,3);&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #6fa8dc;"&gt;var y=new Array('a','g','r');&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #6fa8dc;"&gt;document.write(x.concat(y));&lt;/span&gt;&lt;span style="color: #c27ba0;"&gt;//output is 10,20,78,1,3,a,g,r&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-size: large;"&gt;pop()&lt;/span&gt;- pop function is used to delete the last&amp;nbsp;element&amp;nbsp;in the array and output the deleted element.&lt;br /&gt;
for example&lt;br /&gt;
&lt;br /&gt;
&lt;span style="color: #6fa8dc;"&gt;var x=new Array(10,20,30,40);&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #6fa8dc;"&gt;document.write(x.pop());&lt;/span&gt;&lt;span style="color: #c27ba0;"&gt;//this would delete 40 and output 40;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-size: large;"&gt;shift()&lt;/span&gt; - Similar like pop function, shift is used to delete the first element in the array and output the deleted element.for example&lt;br /&gt;
&lt;br /&gt;
&lt;span style="color: #6fa8dc;"&gt;var x=new Array(10,20,30,40);&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #6fa8dc;"&gt;document.write(x.shift());&lt;/span&gt;&lt;span style="color: #c27ba0;"&gt;//this would delete 10 and output 10;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-size: large;"&gt;push() &lt;/span&gt;- Shift method is used to add an element at the end of the array and return the length of the array.&lt;br /&gt;
for example&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style="color: #6fa8dc;"&gt;var x=new Array(10,20,30,40);&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #6fa8dc;"&gt;document.write(x.push(99));&lt;/span&gt;&lt;span style="color: #c27ba0;"&gt;//and the output would be the length of the new array which is 5, which indicates that 99 has been added as the last element in the array.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-size: large;"&gt;unshift()&lt;/span&gt;- unshift method is used to add an element to the&amp;nbsp;beginning&amp;nbsp;of the array and return the length of the array.for example&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style="color: #6fa8dc;"&gt;var x=new Array(10,20,30,40);&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #6fa8dc;"&gt;document.write(x.push(99));&lt;/span&gt;&lt;span style="color: #c27ba0;"&gt;//and the output would be the length of the new array which is 5, which indicates that 99 has been added as the first element in the array.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-size: large;"&gt;slice()&lt;/span&gt;- slice method is used to retrieve a part of the array.&lt;br /&gt;
for example&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style="color: #6fa8dc;"&gt;var x=new Array(10,20,30,40);&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #6fa8dc;"&gt;document.write(x.slice(1,3));&lt;/span&gt;&lt;span style="color: #c27ba0;"&gt;//output would be 20,30&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-size: large;"&gt;splice()&lt;/span&gt; - Splice method performs two function one is inserting and deleting elements from the array.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
for example&lt;br /&gt;
&lt;br /&gt;
&lt;span style="color: #6fa8dc;"&gt;var x=new Array(10,20,70,40);&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #6fa8dc;"&gt;document.write(x.splice(2,1,30));&lt;/span&gt;&lt;span style="color: #c27ba0;"&gt;//output is 70&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #6fa8dc;"&gt;document.write(x.toString());&lt;/span&gt;&lt;span style="color: #c27ba0;"&gt;//output is 10,20,30,40&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
explanation&lt;br /&gt;
(x.splice(2,1,30)) - this indicates that it add 30 to the 2 nd&amp;nbsp;position&amp;nbsp;and delete 1(one) element from the 2nd position.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Hope this post was useful,will get back with some more post.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;script type="text/javascript"&gt;

  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-37344844-1']);
  _gaq.push(['_setDomainName', 'blogspot.nl']);
  _gaq.push(['_setAllowLinker', true]);
  _gaq.push(['_trackPageview']);

  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://' : 'http://') + 'stats.g.doubleclick.net/dc.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();

&lt;/script&gt;
&lt;a target="_blank" href="http://feeds.feedburner.com/~r/blogspot/Puccab/~6/2"&gt;&lt;img src="http://feeds.feedburner.com/blogspot/Puccab.2.gif" alt="Informative Javascript"&gt;&lt;/a&gt;
&lt;!-- Conduit mobile app redirect - Begin --&gt;
&lt;script type='text/javascript'&gt;/* &lt;![CDATA[ */var Conduit = window.Conduit || {};Conduit.appUrl = 'http://845bbe5e-1fbe-407b-9e92-ac950a288841.conduitapps.com';/* ]]&gt; */&lt;/script&gt;
&lt;script src='http://mobilecp.conduit.com/expagescripts.ashx?type=redirect' type='text/javascript'&gt;&lt;/script&gt;
&lt;!-- Conduit mobile app redirect - End --&gt;</content><link href="http://informativejavascript.blogspot.com/feeds/6085218735209972143/comments/default" rel="replies" title="Post Comments" type="application/atom+xml"/><link href="http://informativejavascript.blogspot.com/2012/12/array-object.html#comment-form" rel="replies" title="1 Comments" type="text/html"/><link href="http://www.blogger.com/feeds/1532203728703326217/posts/default/6085218735209972143" rel="edit" type="application/atom+xml"/><link href="http://www.blogger.com/feeds/1532203728703326217/posts/default/6085218735209972143" rel="self" type="application/atom+xml"/><link href="http://informativejavascript.blogspot.com/2012/12/array-object.html" rel="alternate" title="Array object" type="text/html"/><author><name>Explore</name><uri>http://www.blogger.com/profile/00425180922796668253</uri><email>noreply@blogger.com</email><gd:image height="24" rel="http://schemas.google.com/g/2005#thumbnail" src="//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjMrE7xcsG1gVp9rcGfxNPY1RIPaQ8xUWR-WpmD8iOnDWPD4GhtK788omXSaZafPiy1njw9lYSLUbpmNG6e7DOBkqiWdxFF4vMIVvdRuejAJ4yBERHcF6WbegNnfNbkQA/s1600/*" width="32"/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1532203728703326217.post-5832225292669960367</id><published>2012-12-26T17:57:00.001+01:00</published><updated>2013-08-21T16:09:07.608+02:00</updated><title type="text">Global object</title><content type="html">&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
&lt;br /&gt;
List of global objects are.&lt;br /&gt;
&lt;ol style="text-align: left;"&gt;
&lt;li&gt;eval()&lt;/li&gt;
&lt;li&gt;escape()&lt;/li&gt;
&lt;li&gt;unescape()&lt;/li&gt;
&lt;li&gt;isNaN()&lt;/li&gt;
&lt;li&gt;isfinite()&lt;/li&gt;
&lt;/ol&gt;
&lt;div&gt;
eval() is used to evaluate expression, which is provided within the&amp;nbsp;parenthesis. for example.&lt;/div&gt;
&lt;div&gt;
&lt;span style="color: #6fa8dc;"&gt;eval((2*3)+5);&lt;/span&gt; &lt;span style="background-color: white; color: #c27ba0;"&gt;//output is 11&lt;/span&gt;&lt;br /&gt;
&lt;span style="background-color: white;"&gt;Click on the eval button and try with expression.&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;html&gt;
&lt;input onclick="eval1()" type="button" value="eval" /&gt;
&lt;/html&gt;
&lt;script&gt;
function eval1(){
var x=prompt("enter a exppression");
alert(eval(x));
}
&lt;/script&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="color: #6fa8dc;"&gt;escape('informative javascript');&lt;/span&gt; &lt;span style="color: #c27ba0;"&gt;//output is informative%20javascript&lt;/span&gt;&lt;/div&gt;
&lt;span style="background-color: white;"&gt;Click on the escape button and try with value.&lt;/span&gt;&lt;br /&gt;
&lt;html&gt;
&lt;input onclick="escape1()" type="button" value="escape" /&gt;
&lt;/html&gt;
&lt;script&gt;
function escape1(){
var x=prompt("enter a String");
alert(escape(x));
}
&lt;/script&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="color: #6fa8dc;"&gt;unescape('informative javascript');&lt;/span&gt;&lt;span style="background-color: white;"&gt;&lt;span style="color: #c27ba0;"&gt; //output is informative javascript&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span style="background-color: white;"&gt;Click on the unescape button and try with values.&lt;/span&gt;&lt;br /&gt;
&lt;html&gt;
&lt;input onclick="unescape1()" type="button" value="unescape" /&gt;
&lt;/html&gt;
&lt;script&gt;
function unescape1(){
var x=prompt("enter a String");
alert(unescape(x));
}
&lt;/script&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="color: #6fa8dc;"&gt;isNaN(10);&lt;/span&gt;&amp;nbsp;&lt;span style="color: #c27ba0;"&gt;this check if the specified number is not a number, the output is false because 10 is a number.&lt;/span&gt;&lt;/div&gt;
&lt;span style="background-color: white;"&gt;Click on the NaN button and try with values.&lt;/span&gt;&lt;br /&gt;
&lt;span style="background-color: white;"&gt;&lt;br /&gt;&lt;/span&gt;
&lt;html&gt;
&lt;input onclick="NaN1()" type="button" value="isNaN" /&gt;
&lt;/html&gt;
&lt;script&gt;
function NaN1(){
var x=prompt("enter a number");
alert(isNaN(x));
}
&lt;/script&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;span style="color: #6fa8dc;"&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style="color: #6fa8dc;"&gt;isNaN('a');&lt;/span&gt; &lt;span style="color: #c27ba0;"&gt;this is not a number hence it reflects true in the output.&lt;/span&gt;&lt;/div&gt;
&lt;span style="background-color: white;"&gt;Click on the NaN button and try with value.&lt;/span&gt;&lt;br /&gt;
&lt;html&gt;
&lt;input onclick="NaN1()" type="button" value="isNaN" /&gt;
&lt;/html&gt;
&lt;script&gt;
function NaN1(){
var x=prompt("enter a String");
alert(isNaN(x));
}
&lt;/script&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="color: #6fa8dc;"&gt;isfinite(2334);&lt;/span&gt; &lt;span style="color: #c27ba0;"&gt;checks if the entered value is finite or not.output is true in this case.&lt;/span&gt;&lt;/div&gt;
&lt;span style="background-color: white;"&gt;Click on the Finite button and try with values.&lt;/span&gt;&lt;br /&gt;
&lt;html&gt;
&lt;input onclick="finite1()" type="button" value="isfinite" /&gt;
&lt;/html&gt;
&lt;script&gt;
function finite1(){
var x=prompt("enter a number");
alert(isFinite(x));
}

  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-37344844-1']);
  _gaq.push(['_setDomainName', 'informativejavascript.blogspot.nl']);
  _gaq.push(['_setAllowLinker', true]);
  _gaq.push(['_trackPageview']);

  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://' : 'http://') + 'stats.g.doubleclick.net/dc.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();


&lt;/script&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Hope this post was informative , will get back with more posts.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;a target="_blank" href="http://feeds.feedburner.com/~r/blogspot/Puccab/~6/2"&gt;&lt;img src="http://feeds.feedburner.com/blogspot/Puccab.2.gif" alt="Informative Javascript"&gt;&lt;/a&gt;
&lt;!-- Conduit mobile app redirect - Begin --&gt;
&lt;script type='text/javascript'&gt;/* &lt;![CDATA[ */var Conduit = window.Conduit || {};Conduit.appUrl = 'http://845bbe5e-1fbe-407b-9e92-ac950a288841.conduitapps.com';/* ]]&gt; */&lt;/script&gt;
&lt;script src='http://mobilecp.conduit.com/expagescripts.ashx?type=redirect' type='text/javascript'&gt;&lt;/script&gt;
&lt;!-- Conduit mobile app redirect - End --&gt;</content><link href="http://informativejavascript.blogspot.com/feeds/5832225292669960367/comments/default" rel="replies" title="Post Comments" type="application/atom+xml"/><link href="http://informativejavascript.blogspot.com/2012/12/global-object.html#comment-form" rel="replies" title="0 Comments" type="text/html"/><link href="http://www.blogger.com/feeds/1532203728703326217/posts/default/5832225292669960367" rel="edit" type="application/atom+xml"/><link href="http://www.blogger.com/feeds/1532203728703326217/posts/default/5832225292669960367" rel="self" type="application/atom+xml"/><link href="http://informativejavascript.blogspot.com/2012/12/global-object.html" rel="alternate" title="Global object" type="text/html"/><author><name>Explore</name><uri>http://www.blogger.com/profile/00425180922796668253</uri><email>noreply@blogger.com</email><gd:image height="24" rel="http://schemas.google.com/g/2005#thumbnail" src="//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjMrE7xcsG1gVp9rcGfxNPY1RIPaQ8xUWR-WpmD8iOnDWPD4GhtK788omXSaZafPiy1njw9lYSLUbpmNG6e7DOBkqiWdxFF4vMIVvdRuejAJ4yBERHcF6WbegNnfNbkQA/s1600/*" width="32"/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1532203728703326217.post-6397827075841734110</id><published>2012-12-25T23:08:00.000+01:00</published><updated>2013-08-21T16:08:42.887+02:00</updated><title type="text">Math function</title><content type="html">&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
&lt;br /&gt;
This post will demonstrate the commonly used Math functions.&lt;br /&gt;
&lt;br /&gt;
1. abs() - this function is used to provide the absolute value(which ignores the negative sign). you can try this function by clicking the button and entering a value to find its absolute value.The code is avaliable&lt;br /&gt;
&lt;br /&gt;
&lt;span style="color: #6fa8dc;"&gt;&amp;lt;html&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #6fa8dc;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;input name="button" onclick="abs()" type="button" value="Absolue" /&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #6fa8dc;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;script type="text/javascript"&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #6fa8dc;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; function abs(){&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #6fa8dc;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;absvalue = prompt("Please enter a number:", " ");&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #6fa8dc;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;alert('Absolute value of the number::'+Math.abs(absvalue));&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #6fa8dc;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #6fa8dc;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;/script&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #6fa8dc;"&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;html&gt;
      &lt;input name="button" onclick="abs()" type="button" value="Absolue" /&gt;
      &lt;script type="text/javascript"&gt;
      function abs(){
       absvalue = prompt("Please enter a number:", " ");
       alert('Absolute value of the number::'+Math.abs(absvalue));
       }
      &lt;/script&gt;
&lt;/html&gt;
&lt;br /&gt;
&lt;br /&gt;
2. ceil() - This function provides the next highest integer value.&lt;br /&gt;
Click on the ceil button to explore the functionality.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style="background-color: white; color: #6fa8dc;"&gt;&amp;lt;html&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="background-color: white; color: #6fa8dc;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;input onclick="ceil()" type="button" value="ceil" /&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="background-color: white; color: #6fa8dc;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;script type="text/javascript"&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="background-color: white; color: #6fa8dc;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; function ceil(){&lt;/span&gt;&lt;br /&gt;
&lt;span style="background-color: white; color: #6fa8dc;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;ceilvalue = prompt("Please enter a number:");&lt;/span&gt;&lt;br /&gt;
&lt;span style="background-color: white; color: #6fa8dc;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;alert('Ceil value of the number is::'+Math.ceil(ceilvalue));&lt;/span&gt;&lt;br /&gt;
&lt;span style="background-color: white; color: #6fa8dc;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/span&gt;&lt;br /&gt;
&lt;span style="background-color: white; color: #6fa8dc;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;/script&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="background-color: white; color: #6fa8dc;"&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;html&gt;
      &lt;input onclick="ceil()" type="button" value="ceil" /&gt;
      &lt;script type="text/javascript"&gt;
      function ceil(){
       ceilvalue = prompt("Please enter a number:");
       alert('Ceil value of the number is::'+Math.ceil(ceilvalue));
       }
      &lt;/script&gt;
&lt;/html&gt;
&lt;br /&gt;
&lt;br /&gt;
3. floor() - This function provides the next lowest integer value.&lt;br /&gt;
Click on the floor button to explore the functionality.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style="color: #6fa8dc;"&gt;&amp;lt;html&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #6fa8dc;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;input onclick="floor()" type="button" value="floor" /&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #6fa8dc;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;script type="text/javascript"&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #6fa8dc;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; function floor(){&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #6fa8dc;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;floorvalue = prompt("Please enter a number:");&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #6fa8dc;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;alert('Floor value of the number is::'+Math.floor(floorvalue));&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #6fa8dc;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #6fa8dc;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;/script&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #6fa8dc;"&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Please note while using the ceil and floor function with (negative (-) values) the logic is different for example ceil value of -45.9 is -45 and not -46,&amp;nbsp;similarly&amp;nbsp;floor value of -27.8 is -28 and not -27.&lt;br /&gt;
&lt;br /&gt;
&lt;html&gt;
      &lt;input onclick="floor()" type="button" value="floor" /&gt;
      &lt;script type="text/javascript"&gt;
      function floor(){
       floorvalue = prompt("Please enter a number:");
       alert('Floor value of the number is::'+Math.floor(floorvalue));
       }
      &lt;/script&gt;
&lt;/html&gt;
&lt;br /&gt;
&lt;br /&gt;
5. random() - this number is used to generate random numbers of no particular order.&lt;br /&gt;
&amp;nbsp;Click on the button and check that every time you are displayed with different values.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style="color: #6fa8dc;"&gt;&amp;lt;html&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #6fa8dc;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;input onclick="random()" type="button" value="Random" /&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #6fa8dc;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;script type="text/javascript"&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #6fa8dc;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; function random(){&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #6fa8dc;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;alert('Random number::'+Math.random());&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #6fa8dc;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #6fa8dc;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;/script&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #6fa8dc;"&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;html&gt;
      &lt;input onclick="random()" type="button" value="Random" /&gt;
      &lt;script type="text/javascript"&gt;
      function random(){
       alert('Random number::'+Math.random());
       }
      &lt;/script&gt;
&lt;/html&gt;
&lt;br /&gt;
&lt;br /&gt;
6. max() - This function aids in finding the maximum value out of the given values.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style="color: #6fa8dc;"&gt;&amp;lt;html&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #6fa8dc;"&gt;&amp;nbsp; &amp;lt;script type="text/javascript"&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #6fa8dc;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; function max1(){&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #6fa8dc;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;var t1=document.for1.txt1.value;&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #6fa8dc;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;var t2=document.for1.txt2.value;&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #6fa8dc;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;var t3=document.for1.txt3.value;&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #6fa8dc;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;alert('Max value of the number is::'+Math.max(t1,t2,t3));&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #6fa8dc;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #6fa8dc;"&gt;&amp;nbsp; &amp;nbsp;&amp;lt;/script&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #6fa8dc;"&gt;&amp;lt;form name="for1"&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #6fa8dc;"&gt;Enter the first number:&amp;lt;input name="txt1" type="text" /&amp;gt;&amp;lt;br /&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #6fa8dc;"&gt;Enter the second number:&amp;lt;input name="txt2" type="text" /&amp;gt;&amp;lt;br /&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #6fa8dc;"&gt;Enter the Third number:&amp;lt;input name="txt3" type="text" /&amp;gt;&amp;lt;br /&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #6fa8dc;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;input onclick="max1()" type="button" value="Max value" /&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #6fa8dc;"&gt;&amp;lt;/form&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #6fa8dc;"&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;html&gt;
  &lt;script type="text/javascript"&gt;
      function max1(){
       var t1=document.for1.txt1.value;
       var t2=document.for1.txt2.value;
       var t3=document.for1.txt3.value;
       alert('Max value of the number is::'+Math.max(t1,t2,t3));
       }
   &lt;/script&gt;
&lt;form name="for1"&gt;
Enter the first number:&lt;input name="txt1" type="text" /&gt;&lt;br /&gt;
Enter the second number:&lt;input name="txt2" type="text" /&gt;&lt;br /&gt;
Enter the Third number:&lt;input name="txt3" type="text" /&gt;&lt;br /&gt;
      &lt;input onclick="max1()" type="button" value="Max value" /&gt;
&lt;/form&gt;
&lt;/html&gt;
&lt;br /&gt;
&lt;br /&gt;
7. min() - This function aids in finding the minimum value out of the given values.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style="color: #6fa8dc;"&gt;&amp;lt;html&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #6fa8dc;"&gt;&amp;nbsp; &amp;lt;script type="text/javascript"&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #6fa8dc;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; function min1(){&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #6fa8dc;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;var t1=document.for2.tx1.value;&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #6fa8dc;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;var t2=document.for2.tx2.value;&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #6fa8dc;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;var t3=document.for2.tx3.value;&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #6fa8dc;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;alert('Max value of the number is::'+Math.min(t1,t2,t3));&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #6fa8dc;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #6fa8dc;"&gt;&amp;nbsp; &amp;nbsp;&amp;lt;/script&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #6fa8dc;"&gt;&amp;lt;form name="for2"&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #6fa8dc;"&gt;Enter the first number:&amp;lt;input name="tx1" type="text" /&amp;gt;&amp;lt;br /&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #6fa8dc;"&gt;Enter the second number:&amp;lt;input name="tx2" type="text" /&amp;gt;&amp;lt;br /&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #6fa8dc;"&gt;Enter the Third number:&amp;lt;input name="tx3" type="text" /&amp;gt;&amp;lt;br /&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #6fa8dc;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;input onclick="min1()" type="button" value="Minimum value" /&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #6fa8dc;"&gt;&amp;lt;/form&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #6fa8dc;"&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;html&gt;
  &lt;script type="text/javascript"&gt;
      function min1(){
       var t1=document.for2.tx1.value;
       var t2=document.for2.tx2.value;
       var t3=document.for2.tx3.value;
       alert('Max value of the number is::'+Math.min(t1,t2,t3));
       }
   &lt;/script&gt;
&lt;form name="for2"&gt;
Enter the first number:&lt;input name="tx1" type="text" /&gt;&lt;br /&gt;
Enter the second number:&lt;input name="tx2" type="text" /&gt;&lt;br /&gt;
Enter the Third number:&lt;input name="tx3" type="text" /&gt;&lt;br /&gt;
      &lt;input onclick="min1()" type="button" value="Minimum value" /&gt;
&lt;/form&gt;
&lt;/html&gt;
&lt;br /&gt;
8. round() - This function rounds to the next  integer value.&lt;br /&gt;
Click on the round button to explore the functionality.&lt;br /&gt;
&lt;br /&gt;
&lt;html&gt;
      &lt;input onclick="round()" type="button" value="Round" /&gt;
      &lt;script type="text/javascript"&gt;
      function round(){
       roundvalue = prompt("Please enter a number:");
       alert('Round value of the number is::'+Math.round(roundvalue));
       }
      &lt;/script&gt;
&lt;/html&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style="color: #6fa8dc;"&gt;&amp;lt;html&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #6fa8dc;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;input onclick="round()" type="button" value="Round" /&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #6fa8dc;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;script type="text/javascript"&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #6fa8dc;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; function round(){&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #6fa8dc;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;roundvalue = prompt("Please enter a number:");&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #6fa8dc;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;alert('Round value of the number is::'+Math.round(roundvalue));&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #6fa8dc;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #6fa8dc;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;/script&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #6fa8dc;"&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/div&gt;

&lt;script type="text/javascript"&gt;

  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-37344844-1']);
  _gaq.push(['_setDomainName', 'informativejavascript.blogspot.nl']);
  _gaq.push(['_setAllowLinker', true]);
  _gaq.push(['_trackPageview']);

  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://' : 'http://') + 'stats.g.doubleclick.net/dc.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();

&lt;/script&gt;
&lt;a target="_blank" href="http://feeds.feedburner.com/~r/blogspot/Puccab/~6/2"&gt;&lt;img src="http://feeds.feedburner.com/blogspot/Puccab.2.gif" alt="Informative Javascript"&gt;&lt;/a&gt;
&lt;!-- Conduit mobile app redirect - Begin --&gt;
&lt;script type='text/javascript'&gt;/* &lt;![CDATA[ */var Conduit = window.Conduit || {};Conduit.appUrl = 'http://845bbe5e-1fbe-407b-9e92-ac950a288841.conduitapps.com';/* ]]&gt; */&lt;/script&gt;
&lt;script src='http://mobilecp.conduit.com/expagescripts.ashx?type=redirect' type='text/javascript'&gt;&lt;/script&gt;
&lt;!-- Conduit mobile app redirect - End --&gt;</content><link href="http://informativejavascript.blogspot.com/feeds/6397827075841734110/comments/default" rel="replies" title="Post Comments" type="application/atom+xml"/><link href="http://informativejavascript.blogspot.com/2012/12/math-function.html#comment-form" rel="replies" title="0 Comments" type="text/html"/><link href="http://www.blogger.com/feeds/1532203728703326217/posts/default/6397827075841734110" rel="edit" type="application/atom+xml"/><link href="http://www.blogger.com/feeds/1532203728703326217/posts/default/6397827075841734110" rel="self" type="application/atom+xml"/><link href="http://informativejavascript.blogspot.com/2012/12/math-function.html" rel="alternate" title="Math function" type="text/html"/><author><name>Explore</name><uri>http://www.blogger.com/profile/00425180922796668253</uri><email>noreply@blogger.com</email><gd:image height="24" rel="http://schemas.google.com/g/2005#thumbnail" src="//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjMrE7xcsG1gVp9rcGfxNPY1RIPaQ8xUWR-WpmD8iOnDWPD4GhtK788omXSaZafPiy1njw9lYSLUbpmNG6e7DOBkqiWdxFF4vMIVvdRuejAJ4yBERHcF6WbegNnfNbkQA/s1600/*" width="32"/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1532203728703326217.post-6078120187905823211</id><published>2012-12-25T20:26:00.003+01:00</published><updated>2013-08-21T16:08:29.766+02:00</updated><title type="text">String object</title><content type="html">&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
&lt;br /&gt;
The most commonly used Javascript String objects are listed below with the usage.&lt;br /&gt;
&lt;br /&gt;
1. length()&lt;br /&gt;
&amp;nbsp; &amp;nbsp; Length function is used to determine the length of string but it doesn't use the index count. Always length of string is one more than the index of the last character. for example&lt;br /&gt;
&lt;br /&gt;
&lt;span style="color: #3d85c6;"&gt;var x="Javascript";&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #c27ba0;"&gt;/* index starts with 0 and the last index is 9, but length would be last index +1 which is (9+1=10). hence length of the string is 10 and not 9.*/&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #3d85c6;"&gt;var x="Javascript";&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #3d85c6;"&gt;alert(x.length());&lt;/span&gt; &lt;span style="color: #c27ba0;"&gt;//output is 10;&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #c27ba0;"&gt;&lt;br /&gt;&lt;/span&gt;
2. charAt()&lt;br /&gt;
&amp;nbsp; &amp;nbsp; This function take one parameter which would be the index value and identifies the corresponding character.&lt;br /&gt;
&lt;br /&gt;
&lt;span style="color: #6fa8dc;"&gt;var x="javascript";&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #6fa8dc;"&gt;alert(x.charAt(5));&lt;/span&gt;&lt;span style="color: #d5a6bd;"&gt;//output would be c&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
3. indexOf()&lt;br /&gt;
&amp;nbsp; &amp;nbsp; This string function provides the corresponding index value of the string.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style="color: #6fa8dc;"&gt;var x="javascript";&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #6fa8dc;"&gt;alert(x.indexOf('s'));&lt;/span&gt;&lt;span style="color: #c27ba0;"&gt;//output would be 4&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
4. LastIndexOf()&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp;This string function provides the corresponding index value of the last&amp;nbsp;occurrence&amp;nbsp;of the character specified.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style="color: #6fa8dc;"&gt;var x="javascript";&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #c27ba0;"&gt;&amp;nbsp;/* we know that character 'a' appears twice in the string, inorder to track the index value of the last occurence of the character 'a', we use this function.*/&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #6fa8dc;"&gt;alert(x.lastIndexOf('a'));&lt;/span&gt;&lt;span style="color: #c27ba0;"&gt;//output would be 3&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #c27ba0;"&gt;&lt;br /&gt;&lt;/span&gt;
5. substring()&lt;br /&gt;
&amp;nbsp; &amp;nbsp; If you would like to retrieve a part of the string then this function could be used, unlike others this function requires 2 parameter which holds the index values of the desired string.&lt;br /&gt;
&lt;br /&gt;
&lt;span style="color: #6fa8dc;"&gt;var x="javascript";&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #6fa8dc;"&gt;alert(x.substring(4,10));&lt;/span&gt;&lt;span style="background-color: white;"&gt; &lt;span style="color: #c27ba0;"&gt;//output&amp;nbsp;would&amp;nbsp;be script&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
6. split()&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; Split function takes one parameter as delimiter and split the string into array of strings, for example.&lt;br /&gt;
&lt;br /&gt;
&lt;span style="background-color: white;"&gt;&lt;span style="color: #6fa8dc;"&gt;var x="informative javascript";&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="background-color: white;"&gt;&lt;span style="color: #6fa8dc;"&gt;alert(x.split(" "));&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #c27ba0;"&gt;/* firstly i have used space as the delimiter, now by applying the split function, it splits the string after space and adds them to array.&lt;/span&gt;&lt;span style="color: #c27ba0;"&gt;note the output would be (infirmative,javascript)*/&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
7. toUpperCase(),toLowerCase()&lt;br /&gt;
&amp;nbsp; &amp;nbsp; These functions are used to transform the given string to uppercase and lower case.&lt;br /&gt;
&amp;nbsp; &lt;br /&gt;
var x="JavaScript";&lt;br /&gt;
&lt;span style="background-color: white; color: #6fa8dc;"&gt;alert(x.toUpperCase());&lt;/span&gt;&lt;span style="color: #c27ba0;"&gt;//output would be JAVASCRIPT.&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #6fa8dc;"&gt;alert(x.toLowerCase&lt;span style="background-color: white;"&gt;())&lt;/span&gt;&lt;/span&gt;&lt;span style="background-color: white;"&gt;;&lt;/span&gt;&lt;span style="color: #c27ba0;"&gt;//output would be javascript.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;script type="text/javascript"&gt;

  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-37344844-1']);
  _gaq.push(['_setDomainName', 'informativejavascript.blogspot.nl']);
  _gaq.push(['_setAllowLinker', true]);
  _gaq.push(['_trackPageview']);

  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://' : 'http://') + 'stats.g.doubleclick.net/dc.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();

&lt;/script&gt;
&lt;a target="_blank" href="http://feeds.feedburner.com/~r/blogspot/Puccab/~6/2"&gt;&lt;img src="http://feeds.feedburner.com/blogspot/Puccab.2.gif" alt="Informative Javascript"&gt;&lt;/a&gt;
&lt;!-- Conduit mobile app redirect - Begin --&gt;
&lt;script type='text/javascript'&gt;/* &lt;![CDATA[ */var Conduit = window.Conduit || {};Conduit.appUrl = 'http://845bbe5e-1fbe-407b-9e92-ac950a288841.conduitapps.com';/* ]]&gt; */&lt;/script&gt;
&lt;script src='http://mobilecp.conduit.com/expagescripts.ashx?type=redirect' type='text/javascript'&gt;&lt;/script&gt;
&lt;!-- Conduit mobile app redirect - End --&gt;</content><link href="http://informativejavascript.blogspot.com/feeds/6078120187905823211/comments/default" rel="replies" title="Post Comments" type="application/atom+xml"/><link href="http://informativejavascript.blogspot.com/2012/12/string-object.html#comment-form" rel="replies" title="1 Comments" type="text/html"/><link href="http://www.blogger.com/feeds/1532203728703326217/posts/default/6078120187905823211" rel="edit" type="application/atom+xml"/><link href="http://www.blogger.com/feeds/1532203728703326217/posts/default/6078120187905823211" rel="self" type="application/atom+xml"/><link href="http://informativejavascript.blogspot.com/2012/12/string-object.html" rel="alternate" title="String object" type="text/html"/><author><name>Explore</name><uri>http://www.blogger.com/profile/00425180922796668253</uri><email>noreply@blogger.com</email><gd:image height="24" rel="http://schemas.google.com/g/2005#thumbnail" src="//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjMrE7xcsG1gVp9rcGfxNPY1RIPaQ8xUWR-WpmD8iOnDWPD4GhtK788omXSaZafPiy1njw9lYSLUbpmNG6e7DOBkqiWdxFF4vMIVvdRuejAJ4yBERHcF6WbegNnfNbkQA/s1600/*" width="32"/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1532203728703326217.post-8440892056873487467</id><published>2012-12-25T16:39:00.002+01:00</published><updated>2013-08-21T16:08:18.325+02:00</updated><title type="text">Date Display</title><content type="html">&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
&lt;span style="font-size: large;"&gt;Date Function&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
This post illustrate as how to display the current date on a button click.The date format that I have used in the below example is &lt;span style="color: #6fa8dc;"&gt;dd/mm/yyyy&lt;/span&gt;. we can imply different formats.&lt;br /&gt;
&lt;br /&gt;
1. Add the below code in the body section of the HTML file.&lt;br /&gt;
&lt;br /&gt;
&lt;span style="color: #3d85c6;"&gt;&amp;lt;input type="text" id="dis" /&amp;gt;&amp;lt;br /&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style="color: #3d85c6;"&gt;&amp;lt;input type="button" value="Display Date" onclick="display()" /&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
2. Add the below script in the .js file or you could implement the script in the head section of the HTML file.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style="color: #3d85c6;"&gt;function display(){&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #3d85c6;"&gt;var x="You have clicked";&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #3d85c6;"&gt;var d=new Date();&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #3d85c6;"&gt;var date=d.getDate();&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #3d85c6;"&gt;var month=d.getMonth();&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #3d85c6;"&gt;month++;&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #3d85c6;"&gt;var year=d.getFullYear();&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #3d85c6;"&gt;document.getElementById("dis").value=date+"/"+month+"/"+year;&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #3d85c6;"&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Hope this post was informative. Will get back with more posts shortly.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;script type="text/javascript"&gt;

  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-37344844-1']);
  _gaq.push(['_setDomainName', 'informativejavascript.blogspot.nl']);
  _gaq.push(['_setAllowLinker', true]);
  _gaq.push(['_trackPageview']);

  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://' : 'http://') + 'stats.g.doubleclick.net/dc.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();

&lt;/script&gt;
&lt;a target="_blank" href="http://feeds.feedburner.com/~r/blogspot/Puccab/~6/2"&gt;&lt;img src="http://feeds.feedburner.com/blogspot/Puccab.2.gif" alt="Informative Javascript"&gt;&lt;/a&gt;
&lt;!-- Conduit mobile app redirect - Begin --&gt;
&lt;script type='text/javascript'&gt;/* &lt;![CDATA[ */var Conduit = window.Conduit || {};Conduit.appUrl = 'http://845bbe5e-1fbe-407b-9e92-ac950a288841.conduitapps.com';/* ]]&gt; */&lt;/script&gt;
&lt;script src='http://mobilecp.conduit.com/expagescripts.ashx?type=redirect' type='text/javascript'&gt;&lt;/script&gt;
&lt;!-- Conduit mobile app redirect - End --&gt;</content><link href="http://informativejavascript.blogspot.com/feeds/8440892056873487467/comments/default" rel="replies" title="Post Comments" type="application/atom+xml"/><link href="http://informativejavascript.blogspot.com/2012/12/date-display.html#comment-form" rel="replies" title="0 Comments" type="text/html"/><link href="http://www.blogger.com/feeds/1532203728703326217/posts/default/8440892056873487467" rel="edit" type="application/atom+xml"/><link href="http://www.blogger.com/feeds/1532203728703326217/posts/default/8440892056873487467" rel="self" type="application/atom+xml"/><link href="http://informativejavascript.blogspot.com/2012/12/date-display.html" rel="alternate" title="Date Display" type="text/html"/><author><name>Explore</name><uri>http://www.blogger.com/profile/00425180922796668253</uri><email>noreply@blogger.com</email><gd:image height="24" rel="http://schemas.google.com/g/2005#thumbnail" src="//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjMrE7xcsG1gVp9rcGfxNPY1RIPaQ8xUWR-WpmD8iOnDWPD4GhtK788omXSaZafPiy1njw9lYSLUbpmNG6e7DOBkqiWdxFF4vMIVvdRuejAJ4yBERHcF6WbegNnfNbkQA/s1600/*" width="32"/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1532203728703326217.post-3521968729312721190</id><published>2012-12-25T00:33:00.001+01:00</published><updated>2013-08-21T16:08:05.741+02:00</updated><title type="text">Convert Int to string</title><content type="html">&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
&lt;h2 style="text-align: left;"&gt;
Importance of +""&lt;/h2&gt;
&lt;div&gt;
We all are aware of string to Int conversion,(which could be accomplished by parseInt) but how do we convert a Int to string? We do have&amp;nbsp;multiple&amp;nbsp;solutions but one of the most easiest and commonly used procedure is&amp;nbsp;&lt;span style="color: magenta;"&gt;+""&lt;/span&gt;.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Below example illustrates the same.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="color: #3d85c6;"&gt;var x=Math.random(); &lt;/span&gt;&lt;span style="color: #ea9999;"&gt;// this generates random number and type of x is number.&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="color: #3d85c6;"&gt;var x=Math.random()+"";&lt;/span&gt;&lt;span style="color: #ea9999;"&gt; // now check the type of x its string!!!! how is that possible.&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Note: Just by using +"" it converts the type from number to string. This implementation is mostly used in displaying date. It helps to CONCAT the date, month or year value instead of adding them.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Hope this post was helpful. Will be adding some more post shortly.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;script type="text/javascript"&gt;

  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-37344844-1']);
  _gaq.push(['_setDomainName', 'informativejavascript.blogspot.nl']);
  _gaq.push(['_setAllowLinker', true]);
  _gaq.push(['_trackPageview']);

  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://' : 'http://') + 'stats.g.doubleclick.net/dc.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();

&lt;/script&gt;
&lt;a target="_blank" href="http://feeds.feedburner.com/~r/blogspot/Puccab/~6/2"&gt;&lt;img src="http://feeds.feedburner.com/blogspot/Puccab.2.gif" alt="Informative Javascript"&gt;&lt;/a&gt;
&lt;!-- Conduit mobile app redirect - Begin --&gt;
&lt;script type='text/javascript'&gt;/* &lt;![CDATA[ */var Conduit = window.Conduit || {};Conduit.appUrl = 'http://845bbe5e-1fbe-407b-9e92-ac950a288841.conduitapps.com';/* ]]&gt; */&lt;/script&gt;
&lt;script src='http://mobilecp.conduit.com/expagescripts.ashx?type=redirect' type='text/javascript'&gt;&lt;/script&gt;
&lt;!-- Conduit mobile app redirect - End --&gt;</content><link href="http://informativejavascript.blogspot.com/feeds/3521968729312721190/comments/default" rel="replies" title="Post Comments" type="application/atom+xml"/><link href="http://informativejavascript.blogspot.com/2012/12/convert-int-to-string.html#comment-form" rel="replies" title="3 Comments" type="text/html"/><link href="http://www.blogger.com/feeds/1532203728703326217/posts/default/3521968729312721190" rel="edit" type="application/atom+xml"/><link href="http://www.blogger.com/feeds/1532203728703326217/posts/default/3521968729312721190" rel="self" type="application/atom+xml"/><link href="http://informativejavascript.blogspot.com/2012/12/convert-int-to-string.html" rel="alternate" title="Convert Int to string" type="text/html"/><author><name>Explore</name><uri>http://www.blogger.com/profile/00425180922796668253</uri><email>noreply@blogger.com</email><gd:image height="24" rel="http://schemas.google.com/g/2005#thumbnail" src="//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjMrE7xcsG1gVp9rcGfxNPY1RIPaQ8xUWR-WpmD8iOnDWPD4GhtK788omXSaZafPiy1njw9lYSLUbpmNG6e7DOBkqiWdxFF4vMIVvdRuejAJ4yBERHcF6WbegNnfNbkQA/s1600/*" width="32"/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1532203728703326217.post-7142680943446925460</id><published>2012-12-25T00:01:00.002+01:00</published><updated>2013-08-21T16:07:56.626+02:00</updated><title type="text">Add two numbers</title><content type="html">&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
&lt;h2 style="text-align: left;"&gt;
&lt;/h2&gt;
&lt;h2&gt;
&lt;span style="font-family: Times, 'Times New Roman', serif;"&gt;Adding Two numbers&lt;/span&gt;&lt;/h2&gt;
&lt;div style="font-size: medium; font-weight: normal;"&gt;
&lt;span style="font-family: Times, Times New Roman, serif;"&gt;This post focuses on adding two numbers, adding two numbers does not mean static value but dynamic inputs with a simple number validation. Below is the step by step procedure.&lt;/span&gt;&lt;/div&gt;
&lt;div style="font-size: medium; font-weight: normal;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="font-size: medium; font-weight: normal;"&gt;
&lt;span style="font-family: Times, 'Times New Roman', serif;"&gt;Create a index.html and place the below code in the body section of the HTML file.&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div style="font-size: medium; font-weight: normal;"&gt;
&lt;span style="font-family: Times, Times New Roman, serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #0b5394; font-family: Times, Times New Roman, serif;"&gt;&amp;lt;!DOCTYPE HTML&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style="font-size: medium; font-weight: normal;"&gt;
&lt;span style="color: #0b5394; font-family: Times, Times New Roman, serif;"&gt;&amp;lt;head&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style="font-size: medium; font-weight: normal;"&gt;
&lt;span style="color: #0b5394; font-family: Times, Times New Roman, serif;"&gt;&amp;lt;title&amp;gt;Add two numbers&amp;lt;/title&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style="font-size: medium; font-weight: normal;"&gt;
&lt;span style="color: #0b5394; font-family: Times, Times New Roman, serif;"&gt;&amp;lt;script type="text/javascript" src="script.js" &amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style="font-size: medium; font-weight: normal;"&gt;
&lt;span style="color: #0b5394; font-family: Times, Times New Roman, serif;"&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style="font-size: medium; font-weight: normal;"&gt;
&lt;span style="color: #0b5394; font-family: Times, Times New Roman, serif;"&gt;&amp;lt;body&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style="font-size: medium; font-weight: normal;"&gt;
&lt;span style="color: #0b5394; font-family: Times, Times New Roman, serif;"&gt;Enter the first number: &amp;lt;input type="text" id="txt1" /&amp;gt;&amp;lt;br /&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style="font-size: medium; font-weight: normal;"&gt;
&lt;span style="color: #0b5394; font-family: Times, Times New Roman, serif;"&gt;Enter the seccond number: &amp;lt;input type="text" id="txt2" /&amp;gt;&amp;lt;br /&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style="font-size: medium; font-weight: normal;"&gt;
&lt;span style="color: #0b5394; font-family: Times, Times New Roman, serif;"&gt;&amp;lt;input type="button" onclick="call()" value="Add"/&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style="font-size: medium; font-weight: normal;"&gt;
&lt;span style="color: #0b5394; font-family: Times, Times New Roman, serif;"&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style="font-size: medium; font-weight: normal;"&gt;
&lt;span style="color: #0b5394; font-family: Times, Times New Roman, serif;"&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style="font-size: medium; font-weight: normal;"&gt;
&lt;span style="font-family: Times, 'Times New Roman', serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family: Times, 'Times New Roman', serif;"&gt;Create a javascript file(script.js) with the below content.&lt;/span&gt;&lt;/div&gt;
&lt;div style="font-size: medium; font-weight: normal;"&gt;
&lt;span style="font-family: Times, Times New Roman, serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style="font-size: medium; font-weight: normal;"&gt;
&lt;span style="color: #0b5394; font-family: Times, Times New Roman, serif;"&gt;function call(){&lt;/span&gt;&lt;/div&gt;
&lt;div style="font-size: medium; font-weight: normal;"&gt;
&lt;span style="color: #0b5394; font-family: Times, Times New Roman, serif;"&gt;var q=parseInt(document.getElementById("txt1").value);&lt;/span&gt;&lt;/div&gt;
&lt;div style="font-size: medium; font-weight: normal;"&gt;
&lt;span style="color: #0b5394; font-family: Times, Times New Roman, serif;"&gt;var w=parseInt(document.getElementById("txt2").value);&lt;/span&gt;&lt;/div&gt;
&lt;div style="font-size: medium; font-weight: normal;"&gt;
&lt;span style="color: #0b5394; font-family: Times, Times New Roman, serif;"&gt;var result=q+w;&lt;/span&gt;&lt;/div&gt;
&lt;div style="font-size: medium; font-weight: normal;"&gt;
&lt;span style="color: #0b5394; font-family: Times, Times New Roman, serif;"&gt;&amp;nbsp; &amp;nbsp;if(isNaN(q)||isNaN(w)){&lt;/span&gt;&lt;/div&gt;
&lt;div style="font-size: medium; font-weight: normal;"&gt;
&lt;span style="color: #0b5394; font-family: Times, Times New Roman, serif;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; alert("please enter a number");&lt;/span&gt;&lt;/div&gt;
&lt;div style="font-size: medium; font-weight: normal;"&gt;
&lt;span style="color: #0b5394; font-family: Times, Times New Roman, serif;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/span&gt;&lt;/div&gt;
&lt;div style="font-size: medium; font-weight: normal;"&gt;
&lt;span style="color: #0b5394; font-family: Times, Times New Roman, serif;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;else&lt;/span&gt;&lt;/div&gt;
&lt;div style="font-size: medium; font-weight: normal;"&gt;
&lt;span style="color: #0b5394; font-family: Times, Times New Roman, serif;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;/div&gt;
&lt;div style="font-size: medium; font-weight: normal;"&gt;
&lt;span style="color: #0b5394; font-family: Times, Times New Roman, serif;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;var result=q+w;&lt;/span&gt;&lt;/div&gt;
&lt;div style="font-size: medium; font-weight: normal;"&gt;
&lt;span style="color: #0b5394; font-family: Times, Times New Roman, serif;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;alert("The sum is " +result);&lt;/span&gt;&lt;/div&gt;
&lt;div style="font-size: medium; font-weight: normal;"&gt;
&lt;span style="color: #0b5394; font-family: Times, Times New Roman, serif;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/span&gt;&lt;/div&gt;
&lt;div style="font-size: medium; font-weight: normal;"&gt;
&lt;span style="color: #0b5394; font-family: Times, Times New Roman, serif;"&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;div style="font-size: medium; font-weight: normal;"&gt;
&lt;span style="font-family: Times, Times New Roman, serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family: Times, Times New Roman, serif;"&gt;Please do not forget to&amp;nbsp;&lt;/span&gt;&lt;span style="font-family: Times, 'Times New Roman', serif;"&gt;include the javascript file(script.js) in the index.html.&lt;/span&gt;&lt;/div&gt;
&lt;div style="font-size: medium; font-weight: normal;"&gt;
&lt;span style="font-family: Times, Times New Roman, serif;"&gt;In this example you would have observed the following javascript terms.&lt;/span&gt;&lt;/div&gt;
&lt;ul style="font-size: medium; font-weight: normal;"&gt;
&lt;li&gt;&lt;span style="font-family: Times, Times New Roman, serif;"&gt;onclick&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style="font-family: Times, Times New Roman, serif;"&gt;document.getElementById&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style="font-family: Times, Times New Roman, serif;"&gt;parseInt&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style="font-family: Times, Times New Roman, serif;"&gt;isNaN&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;div style="font-size: medium; font-weight: normal;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="font-size: medium; font-weight: normal;"&gt;
&lt;span style="font-family: Times, Times New Roman, serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family: Times, Times New Roman, serif;"&gt;1. onclick-In the above example onclick it calls the function call();&lt;/span&gt;&lt;/div&gt;
&lt;div style="font-size: medium; font-weight: normal;"&gt;
&lt;span style="font-family: Times, Times New Roman, serif;"&gt;2. document.getElementById -gets the values entered in the input fields which defined with id's txt1 and txt2.&lt;/span&gt;&lt;/div&gt;
&lt;div style="font-size: medium; font-weight: normal;"&gt;
&lt;span style="font-family: Times, Times New Roman, serif;"&gt;3.parseInt - converts the value to Int type.&lt;/span&gt;&lt;/div&gt;
&lt;div style="font-size: medium; font-weight: normal;"&gt;
&lt;span style="font-family: Times, Times New Roman, serif;"&gt;4.isNaN - checks if the value is NaN.&lt;/span&gt;&lt;/div&gt;
&lt;div style="font-size: medium; font-weight: normal;"&gt;
&lt;span style="font-family: Times, Times New Roman, serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #e06666; font-family: Times, Times New Roman, serif;"&gt;&lt;u&gt;Couple of things to be noted&lt;/u&gt;&lt;/span&gt;&lt;/div&gt;
&lt;ol style="font-size: medium; font-weight: normal;"&gt;
&lt;li&gt;&lt;span style="font-family: Times, Times New Roman, serif;"&gt;document.getElementById always returns a string value, so we need to convert the value to Int(parseInt) for mathematical operations.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style="font-family: Times, Times New Roman, serif;"&gt;In order&amp;nbsp;to ensure that the entered inputs are only numbers , a if condition is implemented to check the values. If the entered value is not a number then it would alert with(please enter a number).&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;div style="font-size: medium; font-weight: normal;"&gt;
&lt;span style="font-family: Times, Times New Roman, serif;"&gt;Thorough this example we can add dynamic inputs and validate.&lt;/span&gt;&lt;/div&gt;
&lt;div style="font-size: medium; font-weight: normal;"&gt;
&lt;span style="font-family: Times, Times New Roman, serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style="font-size: medium; font-weight: normal;"&gt;
&lt;span style="font-family: Times, Times New Roman, serif;"&gt;Hope this post was informative, would be adding some more post shortly.&lt;/span&gt;&lt;/div&gt;
&lt;div style="font-size: medium; font-weight: normal;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="font-size: medium; font-weight: normal;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="font-size: medium; font-weight: normal;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;script type="text/javascript"&gt;

  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-37344844-1']);
  _gaq.push(['_setDomainName', 'informativejavascript.blogspot.nl']);
  _gaq.push(['_setAllowLinker', true]);
  _gaq.push(['_trackPageview']);

  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://' : 'http://') + 'stats.g.doubleclick.net/dc.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();

&lt;/script&gt;

&lt;a target="_blank" href="http://feeds.feedburner.com/~r/blogspot/Puccab/~6/2"&gt;&lt;img src="http://feeds.feedburner.com/blogspot/Puccab.2.gif" alt="Informative Javascript"&gt;&lt;/a&gt;
&lt;!-- Conduit mobile app redirect - Begin --&gt;
&lt;script type='text/javascript'&gt;/* &lt;![CDATA[ */var Conduit = window.Conduit || {};Conduit.appUrl = 'http://845bbe5e-1fbe-407b-9e92-ac950a288841.conduitapps.com';/* ]]&gt; */&lt;/script&gt;
&lt;script src='http://mobilecp.conduit.com/expagescripts.ashx?type=redirect' type='text/javascript'&gt;&lt;/script&gt;
&lt;!-- Conduit mobile app redirect - End --&gt;</content><link href="http://informativejavascript.blogspot.com/feeds/7142680943446925460/comments/default" rel="replies" title="Post Comments" type="application/atom+xml"/><link href="http://informativejavascript.blogspot.com/2012/12/javascript-basics.html#comment-form" rel="replies" title="42 Comments" type="text/html"/><link href="http://www.blogger.com/feeds/1532203728703326217/posts/default/7142680943446925460" rel="edit" type="application/atom+xml"/><link href="http://www.blogger.com/feeds/1532203728703326217/posts/default/7142680943446925460" rel="self" type="application/atom+xml"/><link href="http://informativejavascript.blogspot.com/2012/12/javascript-basics.html" rel="alternate" title="Add two numbers" type="text/html"/><author><name>Explore</name><uri>http://www.blogger.com/profile/00425180922796668253</uri><email>noreply@blogger.com</email><gd:image height="24" rel="http://schemas.google.com/g/2005#thumbnail" src="//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjMrE7xcsG1gVp9rcGfxNPY1RIPaQ8xUWR-WpmD8iOnDWPD4GhtK788omXSaZafPiy1njw9lYSLUbpmNG6e7DOBkqiWdxFF4vMIVvdRuejAJ4yBERHcF6WbegNnfNbkQA/s1600/*" width="32"/></author><thr:total>42</thr:total></entry></feed>