<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-8707790305856929068</id><updated>2012-02-16T01:31:41.758-08:00</updated><category term='Return Statement'/><category term='Threading'/><category term='Loops'/><category term='Continue'/><category term='HTML Forms and Javascript'/><category term='For in'/><category term='XML'/><category term='Date Objects'/><category term='Throw Statement'/><category term='javascript XML'/><category term='Boolean'/><category term='Ajax'/><category term='Tutorials'/><category term='Functions'/><category term='Break'/><category term='Array'/><category term='Autosuggest and Autocomplete'/><category term='Methods'/><category term='String Object'/><category term='OOPS'/><category term='Variables'/><category term='PopUp Boxes'/><category term='Operators'/><category term='Math Object'/><category term='Calendars'/><category term='Questions and Answers'/><category term='Events'/><category term='Enum'/><category term='Javascript Guidelines'/><category term='Try and Catch'/><category term='Statements'/><category term='Special Characters'/><category term='Examples'/><title type='text'>Javascript Factory</title><subtitle type='html'>A factory to share all the javascript stuffs. javascript examples, javascript code, javascript samples and much more. javascript tutorials</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://javascriptfactory.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8707790305856929068/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://javascriptfactory.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Vipin C</name><uri>http://www.blogger.com/profile/01967245433419006643</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>89</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-8707790305856929068.post-2090925167451665730</id><published>2009-10-19T23:32:00.000-07:00</published><updated>2009-10-19T23:32:44.903-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Math Object'/><title type='text'>Javascript : Mathematical Methods</title><content type='html'>&lt;span style="font-size: small;"&gt;&lt;/span&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;In addition to the mathematical constants that can be accessed from the Math object there are also several methods available.&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;The following example uses the round() method of the Math object to round a number to the nearest integer:&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;table border="0" cellpadding="0" cellspacing="0" class="code" style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;span style="font-size: small;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style="font-size: small;"&gt;document.write(Math.round(4.7));&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;The code above will result in the following output:&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;table border="0" cellpadding="0" cellspacing="0" class="code" style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;span style="font-size: small;"&gt;5&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;The following example uses the random() method of the Math object to return a random number between 0 and 1:&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;table border="0" cellpadding="0" cellspacing="0" class="code" style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;span style="font-size: small;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style="font-size: small;"&gt;document.write(Math.random());&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;The code above can result in the following output:&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;table border="0" cellpadding="0" cellspacing="0" class="code" style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;script type="text/javascript"&gt;document.write(Math.random())&lt;/script&gt;&lt;span style="font-size: small;"&gt;0.6936874867631697&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style="font-size: small;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;The following example uses the floor() and random() methods of the Math object to return a random number between 0 and 10:&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;table border="0" cellpadding="0" cellspacing="0" class="code" style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;span style="font-size: small;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style="font-size: small;"&gt;document.write(Math.floor(Math.random()*11));&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;The code above can result in the following output:&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;script type="text/javascript"&gt; document.write(Math.floor(Math.random()*11))&lt;/script&gt;&lt;span style="font-size: small;"&gt;&lt;span style="font-family: Arial,Helvetica,sans-serif;"&gt;0&lt;/span&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8707790305856929068-2090925167451665730?l=javascriptfactory.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javascriptfactory.blogspot.com/feeds/2090925167451665730/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://javascriptfactory.blogspot.com/2009/10/javascript-mathematical-methods.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8707790305856929068/posts/default/2090925167451665730'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8707790305856929068/posts/default/2090925167451665730'/><link rel='alternate' type='text/html' href='http://javascriptfactory.blogspot.com/2009/10/javascript-mathematical-methods.html' title='Javascript : Mathematical Methods'/><author><name>Vipin C</name><uri>http://www.blogger.com/profile/01967245433419006643</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8707790305856929068.post-624038310318432235</id><published>2009-10-19T23:31:00.001-07:00</published><updated>2009-10-19T23:31:34.857-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Math Object'/><title type='text'>Javascript : Mathematical Constants</title><content type='html'>&lt;span style="font-size: small;"&gt;&lt;/span&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;JavaScript provides eight mathematical constants that can be accessed from the Math object. These are: E, PI, square root of 2, square root of 1/2, natural log of 2, natural log of 10, base-2 log of E, and base-10 log of E.&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;You may reference these constants from your JavaScript like this:&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;blockquote&gt;&lt;span style="font-size: small;"&gt;&lt;span style="font-family: Arial,Helvetica,sans-serif;"&gt; Math.E&lt;/span&gt;&lt;/span&gt;&lt;br style="font-family: Arial,Helvetica,sans-serif;" /&gt;&lt;span style="font-size: small;"&gt;&lt;span style="font-family: Arial,Helvetica,sans-serif;"&gt; Math.PI&lt;/span&gt;&lt;/span&gt;&lt;br style="font-family: Arial,Helvetica,sans-serif;" /&gt;&lt;span style="font-size: small;"&gt;&lt;span style="font-family: Arial,Helvetica,sans-serif;"&gt; Math.SQRT2&lt;/span&gt;&lt;/span&gt;&lt;br style="font-family: Arial,Helvetica,sans-serif;" /&gt;&lt;span style="font-size: small;"&gt;&lt;span style="font-family: Arial,Helvetica,sans-serif;"&gt; Math.SQRT1_2&lt;/span&gt;&lt;/span&gt;&lt;br style="font-family: Arial,Helvetica,sans-serif;" /&gt;&lt;span style="font-size: small;"&gt;&lt;span style="font-family: Arial,Helvetica,sans-serif;"&gt; Math.LN2&lt;/span&gt;&lt;/span&gt;&lt;br style="font-family: Arial,Helvetica,sans-serif;" /&gt;&lt;span style="font-size: small;"&gt;&lt;span style="font-family: Arial,Helvetica,sans-serif;"&gt; Math.LN10&lt;/span&gt;&lt;/span&gt;&lt;br style="font-family: Arial,Helvetica,sans-serif;" /&gt;&lt;span style="font-size: small;"&gt;&lt;span style="font-family: Arial,Helvetica,sans-serif;"&gt; Math.LOG2E&lt;/span&gt;&lt;/span&gt;&lt;br style="font-family: Arial,Helvetica,sans-serif;" /&gt;&lt;span style="font-size: small;"&gt;&lt;span style="font-family: Arial,Helvetica,sans-serif;"&gt; Math.LOG10E&lt;/span&gt;&lt;/span&gt;&lt;/blockquote&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8707790305856929068-624038310318432235?l=javascriptfactory.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javascriptfactory.blogspot.com/feeds/624038310318432235/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://javascriptfactory.blogspot.com/2009/10/javascript-mathematical-constants.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8707790305856929068/posts/default/624038310318432235'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8707790305856929068/posts/default/624038310318432235'/><link rel='alternate' type='text/html' href='http://javascriptfactory.blogspot.com/2009/10/javascript-mathematical-constants.html' title='Javascript : Mathematical Constants'/><author><name>Vipin C</name><uri>http://www.blogger.com/profile/01967245433419006643</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8707790305856929068.post-6793483028944516736</id><published>2009-10-19T23:30:00.001-07:00</published><updated>2009-10-19T23:30:45.083-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Math Object'/><title type='text'>Javascript Math Object</title><content type='html'>&lt;span style="font-size: small;"&gt;&lt;/span&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;The Math object allows you to perform mathematical tasks.&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;h2 style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;Math Object&lt;/span&gt;&lt;/h2&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;The Math object allows you to perform mathematical tasks.&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;The Math object includes several mathematical constants and methods.&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&lt;b&gt;Syntax for using properties/methods of Math:&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;table border="0" cellpadding="0" cellspacing="0" class="code" style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;span style="font-size: small;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style="font-size: small;"&gt;var pi_value=Math.PI;&lt;br /&gt;var sqrt_value=Math.sqrt(16);&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&lt;b&gt;Note:&lt;/b&gt; Math is not a constructor. All properties and methods of Math can be called by using Math as an object without creating it.&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8707790305856929068-6793483028944516736?l=javascriptfactory.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javascriptfactory.blogspot.com/feeds/6793483028944516736/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://javascriptfactory.blogspot.com/2009/10/javascript-math-object.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8707790305856929068/posts/default/6793483028944516736'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8707790305856929068/posts/default/6793483028944516736'/><link rel='alternate' type='text/html' href='http://javascriptfactory.blogspot.com/2009/10/javascript-math-object.html' title='Javascript Math Object'/><author><name>Vipin C</name><uri>http://www.blogger.com/profile/01967245433419006643</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8707790305856929068.post-2568252713450697500</id><published>2009-10-19T23:29:00.000-07:00</published><updated>2009-10-19T23:29:43.950-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Boolean'/><title type='text'>Javascript Boolean Object</title><content type='html'>&lt;span style="font-size: small;"&gt;&lt;/span&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;The Boolean object is used to convert a non-Boolean value to a Boolean value (true or false).&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;The Boolean object represents two values: "true" or "false".&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;The following code creates a Boolean object called myBoolean:&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;table border="0" cellpadding="0" cellspacing="0" class="code" style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;span style="font-size: small;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style="font-size: small;"&gt;var myBoolean=new Boolean();&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&lt;b&gt;Note:&lt;/b&gt; If the Boolean object has no initial value or if it is 0, -0, null, "", false, undefined,  or NaN, the object is set to false. Otherwise it is true (even with the string "false")!&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;All the following lines of code create Boolean objects with an initial value of false:&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;table border="0" cellpadding="0" cellspacing="0" class="code" style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;span style="font-size: small;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style="font-size: small;"&gt;var myBoolean=new Boolean();&lt;br /&gt;var myBoolean=new Boolean(0);&lt;br /&gt;var myBoolean=new Boolean(null);&lt;br /&gt;var myBoolean=new Boolean("");&lt;br /&gt;var myBoolean=new Boolean(false);&lt;br /&gt;var myBoolean=new Boolean(NaN);&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;And all the following lines of code create Boolean objects with an initial value of true:&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;span style="font-size: small;"&gt;&lt;span style="font-family: Arial,Helvetica,sans-serif;"&gt;var myBoolean=new Boolean(true);&lt;/span&gt;&lt;br style="font-family: Arial,Helvetica,sans-serif;" /&gt;&lt;span style="font-family: Arial,Helvetica,sans-serif;"&gt; var myBoolean=new Boolean("true");&lt;/span&gt;&lt;br style="font-family: Arial,Helvetica,sans-serif;" /&gt;&lt;span style="font-family: Arial,Helvetica,sans-serif;"&gt; var myBoolean=new Boolean("false");&lt;/span&gt;&lt;br style="font-family: Arial,Helvetica,sans-serif;" /&gt;&lt;span style="font-family: Arial,Helvetica,sans-serif;"&gt; var myBoolean=new Boolean("Richard");&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8707790305856929068-2568252713450697500?l=javascriptfactory.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javascriptfactory.blogspot.com/feeds/2568252713450697500/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://javascriptfactory.blogspot.com/2009/10/javascript-boolean-object.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8707790305856929068/posts/default/2568252713450697500'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8707790305856929068/posts/default/2568252713450697500'/><link rel='alternate' type='text/html' href='http://javascriptfactory.blogspot.com/2009/10/javascript-boolean-object.html' title='Javascript Boolean Object'/><author><name>Vipin C</name><uri>http://www.blogger.com/profile/01967245433419006643</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8707790305856929068.post-7509085176829608145</id><published>2009-10-19T23:28:00.000-07:00</published><updated>2009-10-19T23:28:02.230-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Array'/><title type='text'>Javascript : Modify Values in an Array</title><content type='html'>&lt;span style="font-size: small;"&gt;&lt;/span&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;To modify a value in an existing array, just add a new value to the array with a specified index number:&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;table border="0" cellpadding="0" cellspacing="0" class="code" style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;span style="font-size: small;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style="font-size: small;"&gt;myCars[0]="Opel";&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;Now, the following code line:&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;table border="0" cellpadding="0" cellspacing="0" class="code" style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;span style="font-size: small;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style="font-size: small;"&gt;document.write(myCars[0]);&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;will result in the following output:&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;span style="font-size: small;"&gt;&lt;span style="font-family: Arial,Helvetica,sans-serif;"&gt;Opel&lt;/span&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8707790305856929068-7509085176829608145?l=javascriptfactory.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javascriptfactory.blogspot.com/feeds/7509085176829608145/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://javascriptfactory.blogspot.com/2009/10/javascript-modify-values-in-array.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8707790305856929068/posts/default/7509085176829608145'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8707790305856929068/posts/default/7509085176829608145'/><link rel='alternate' type='text/html' href='http://javascriptfactory.blogspot.com/2009/10/javascript-modify-values-in-array.html' title='Javascript : Modify Values in an Array'/><author><name>Vipin C</name><uri>http://www.blogger.com/profile/01967245433419006643</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8707790305856929068.post-3658414523334621214</id><published>2009-10-19T23:27:00.000-07:00</published><updated>2009-10-19T23:27:12.179-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Array'/><title type='text'>javascript : Access an Array</title><content type='html'>&lt;span style="font-size: small;"&gt;&lt;/span&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;You can refer to a particular element in an array by referring to the name of the array and the index number. The index number starts at 0.&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;The following code line:&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;table border="0" cellpadding="0" cellspacing="0" class="code" height="19" style="font-family: Arial,Helvetica,sans-serif; width: 676px;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;span style="font-size: small;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style="font-size: small;"&gt;document.write(myCars[0]);&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;will result in the following output:&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;span style="font-size: small;"&gt;&lt;span style="font-family: Arial,Helvetica,sans-serif;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: small;"&gt;&lt;span style="font-family: Arial,Helvetica,sans-serif;"&gt;Saab&lt;/span&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8707790305856929068-3658414523334621214?l=javascriptfactory.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javascriptfactory.blogspot.com/feeds/3658414523334621214/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://javascriptfactory.blogspot.com/2009/10/javascript-access-array.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8707790305856929068/posts/default/3658414523334621214'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8707790305856929068/posts/default/3658414523334621214'/><link rel='alternate' type='text/html' href='http://javascriptfactory.blogspot.com/2009/10/javascript-access-array.html' title='javascript : Access an Array'/><author><name>Vipin C</name><uri>http://www.blogger.com/profile/01967245433419006643</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8707790305856929068.post-5663916623280810357</id><published>2009-10-19T23:26:00.000-07:00</published><updated>2009-10-19T23:26:20.941-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Array'/><title type='text'>Javascript : Create an Array</title><content type='html'>&lt;span style="font-size: small;"&gt;&lt;/span&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;The following code creates an Array object called myCars:&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;table border="0" cellpadding="0" cellspacing="0" class="code" style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;span style="font-size: small;"&gt;var myCars=new Array();&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;There are two ways of adding values to an array (you can add as many values as you need to define as many variables you require).&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;1:&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;table border="0" cellpadding="0" cellspacing="0" class="code" style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;span style="font-size: small;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style="font-size: small;"&gt;var myCars=new Array();&lt;br /&gt;myCars[0]="Saab";&lt;br /&gt;myCars[1]="Volvo";&lt;br /&gt;myCars[2]="BMW";&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;You could also pass an integer argument to control the array's size:&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;table border="0" cellpadding="0" cellspacing="0" class="code" style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;span style="font-size: small;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style="font-size: small;"&gt;var myCars=new Array(3);&lt;br /&gt;myCars[0]="Saab";&lt;br /&gt;myCars[1]="Volvo";&lt;br /&gt;myCars[2]="BMW";&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;2:&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;table border="0" cellpadding="0" cellspacing="0" class="code" style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;span style="font-size: small;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style="font-size: small;"&gt;var myCars=new Array("Saab","Volvo","BMW");&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&lt;b&gt;Note:&lt;/b&gt; If you specify numbers or true/false values inside the array then the type of variables will be numeric or Boolean instead of string.&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8707790305856929068-5663916623280810357?l=javascriptfactory.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javascriptfactory.blogspot.com/feeds/5663916623280810357/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://javascriptfactory.blogspot.com/2009/10/javascript-create-array.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8707790305856929068/posts/default/5663916623280810357'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8707790305856929068/posts/default/5663916623280810357'/><link rel='alternate' type='text/html' href='http://javascriptfactory.blogspot.com/2009/10/javascript-create-array.html' title='Javascript : Create an Array'/><author><name>Vipin C</name><uri>http://www.blogger.com/profile/01967245433419006643</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8707790305856929068.post-5278913247290163074</id><published>2009-10-19T23:25:00.000-07:00</published><updated>2009-10-19T23:25:03.076-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Array'/><title type='text'>Javascript Array Object</title><content type='html'>&lt;span style="font-size: small;"&gt;&lt;/span&gt;&lt;h2 style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;What is an Array?&lt;/span&gt;&lt;/h2&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;An array is a special variable, which can hold more than one value, at a  time.&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;If you have a list of items (a list of car names, for example), storing the  cars  in single variables could look like this:&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;table border="0" cellpadding="0" cellspacing="0" class="code" id="table1" style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;span style="font-size: small;"&gt; cars1="Saab";&lt;br /&gt;cars2="Volvo";&lt;br /&gt;cars3="BMW"; &lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;However, what if you want to loop through the cars and find a specific one?  And what if you had not 3 cars, but 300?&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;The best solution here is to use an array!&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;An array can hold all your variable values under a single name. And you can  access the values by referring to the array name.&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;Each element in the array has its own ID so that it can be easily accessed.&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8707790305856929068-5278913247290163074?l=javascriptfactory.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javascriptfactory.blogspot.com/feeds/5278913247290163074/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://javascriptfactory.blogspot.com/2009/10/javascript-array-object.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8707790305856929068/posts/default/5278913247290163074'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8707790305856929068/posts/default/5278913247290163074'/><link rel='alternate' type='text/html' href='http://javascriptfactory.blogspot.com/2009/10/javascript-array-object.html' title='Javascript Array Object'/><author><name>Vipin C</name><uri>http://www.blogger.com/profile/01967245433419006643</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8707790305856929068.post-6532479949158749612</id><published>2009-10-07T06:39:00.000-07:00</published><updated>2009-10-07T06:39:17.921-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Date Objects'/><title type='text'>Javascript : Date Object</title><content type='html'>&lt;span style="font-size: small;"&gt;&lt;/span&gt;&lt;h2 style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;Create a Date Object&lt;/span&gt;&lt;/h2&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;The Date object is used to work with dates and times.&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;The following code create a Date object called myDate:&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;table border="0" cellpadding="0" cellspacing="0" class="code" style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;span style="font-size: small;"&gt;var myDate=new Date()&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&lt;b&gt;Note:&lt;/b&gt; The Date object will automatically hold the current date and time as its initial value!&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;hr style="font-family: Arial,Helvetica,sans-serif;" /&gt;  &lt;h2 style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;Set Dates&lt;/span&gt;&lt;/h2&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;We can easily manipulate the date by using the methods available for the Date object.&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;In the example below we set a Date object to a specific date (14th January 2010):&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;table border="0" cellpadding="0" cellspacing="0" class="code" style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;span style="font-size: small;"&gt; var myDate=new Date();&lt;br /&gt;myDate.setFullYear(2010,0,14);&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;And in the following example we set a Date object to be 5 days into the future:&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;table border="0" cellpadding="0" cellspacing="0" class="code" style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;span style="font-size: small;"&gt; var myDate=new Date();&lt;br /&gt;myDate.setDate(myDate.getDate()+5);&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&lt;b&gt;Note:&lt;/b&gt; If adding five days to a date shifts the month or year, the changes are handled automatically by the Date object itself!&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;hr style="font-family: Arial,Helvetica,sans-serif;" /&gt;  &lt;h2 style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;Compare Two Dates&lt;/span&gt;&lt;/h2&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;The Date object is also used to compare two dates.&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;The following example compares today's date with the 14th January 2010:&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;span style="font-size: small;"&gt;&lt;span style="font-family: Arial,Helvetica,sans-serif;"&gt; var myDate=new Date();&lt;/span&gt;&lt;br style="font-family: Arial,Helvetica,sans-serif;" /&gt;&lt;span style="font-family: Arial,Helvetica,sans-serif;"&gt; myDate.setFullYear(2010,0,14);&lt;/span&gt;&lt;br style="font-family: Arial,Helvetica,sans-serif;" /&gt;&lt;span style="font-family: Arial,Helvetica,sans-serif;"&gt;var today = new Date();&lt;/span&gt;&lt;br style="font-family: Arial,Helvetica,sans-serif;" /&gt;&lt;br style="font-family: Arial,Helvetica,sans-serif;" /&gt;&lt;span style="font-family: Arial,Helvetica,sans-serif;"&gt; if (myDate&amp;gt;today)&lt;/span&gt;&lt;br style="font-family: Arial,Helvetica,sans-serif;" /&gt;&lt;span style="font-family: Arial,Helvetica,sans-serif;"&gt; &amp;nbsp; {&lt;/span&gt;&lt;br style="font-family: Arial,Helvetica,sans-serif;" /&gt;&lt;span style="font-family: Arial,Helvetica,sans-serif;"&gt; &amp;nbsp; alert("Today is before 14th January 2010");&lt;/span&gt;&lt;br style="font-family: Arial,Helvetica,sans-serif;" /&gt;&lt;span style="font-family: Arial,Helvetica,sans-serif;"&gt; &amp;nbsp; }&lt;/span&gt;&lt;br style="font-family: Arial,Helvetica,sans-serif;" /&gt;&lt;span style="font-family: Arial,Helvetica,sans-serif;"&gt; else&lt;/span&gt;&lt;br style="font-family: Arial,Helvetica,sans-serif;" /&gt;&lt;span style="font-family: Arial,Helvetica,sans-serif;"&gt; &amp;nbsp; {&lt;/span&gt;&lt;br style="font-family: Arial,Helvetica,sans-serif;" /&gt;&lt;span style="font-family: Arial,Helvetica,sans-serif;"&gt; &amp;nbsp; alert("Today is after 14th January 2010");&lt;/span&gt;&lt;br style="font-family: Arial,Helvetica,sans-serif;" /&gt;&lt;span style="font-family: Arial,Helvetica,sans-serif;"&gt; &amp;nbsp; }&lt;/span&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8707790305856929068-6532479949158749612?l=javascriptfactory.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javascriptfactory.blogspot.com/feeds/6532479949158749612/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://javascriptfactory.blogspot.com/2009/10/javascript-date-object.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8707790305856929068/posts/default/6532479949158749612'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8707790305856929068/posts/default/6532479949158749612'/><link rel='alternate' type='text/html' href='http://javascriptfactory.blogspot.com/2009/10/javascript-date-object.html' title='Javascript : Date Object'/><author><name>Vipin C</name><uri>http://www.blogger.com/profile/01967245433419006643</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8707790305856929068.post-5159797419569444871</id><published>2009-10-07T06:36:00.000-07:00</published><updated>2009-10-07T06:36:42.924-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='String Object'/><title type='text'>Javascript :  String Object</title><content type='html'>&lt;span style="font-size: small;"&gt;&lt;/span&gt;&lt;span style="font-family: Arial,Helvetica,sans-serif; font-size: small;"&gt;&lt;/span&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;The String object is used to manipulate a stored piece of text.&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&lt;b&gt;Examples of use:&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;The following example uses the length property of the String object to find the length of a string:&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;table border="0" cellpadding="0" cellspacing="0" class="code" style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;span style="font-size: small;"&gt; &lt;i&gt;var txt="Hello world!";&lt;br /&gt;document.write(txt.length);&lt;/i&gt;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;The code above will result in the following output:&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;table border="0" cellpadding="0" cellspacing="0" class="code" style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;span style="font-size: small;"&gt;12&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;The following example uses the toUpperCase() method of the String object to convert a string to uppercase letters:&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;table border="0" cellpadding="0" cellspacing="0" class="code" style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;span style="font-size: small;"&gt; &lt;i&gt;var txt="Hello world!";&lt;br /&gt;document.write(txt.toUpperCase());&lt;/i&gt;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;The code above will result in the following output:&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;span style="font-family: Arial,Helvetica,sans-serif; font-size: small;"&gt;HELLO WORLD!&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8707790305856929068-5159797419569444871?l=javascriptfactory.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javascriptfactory.blogspot.com/feeds/5159797419569444871/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://javascriptfactory.blogspot.com/2009/10/javascript-string-object.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8707790305856929068/posts/default/5159797419569444871'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8707790305856929068/posts/default/5159797419569444871'/><link rel='alternate' type='text/html' href='http://javascriptfactory.blogspot.com/2009/10/javascript-string-object.html' title='Javascript :  String Object'/><author><name>Vipin C</name><uri>http://www.blogger.com/profile/01967245433419006643</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8707790305856929068.post-4724705545873505206</id><published>2009-10-07T06:34:00.000-07:00</published><updated>2009-10-07T06:34:35.828-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Methods'/><category scheme='http://www.blogger.com/atom/ns#' term='OOPS'/><title type='text'>javascript : Methods</title><content type='html'>&lt;span style="font-size: small;"&gt;&lt;/span&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;Methods are the actions that can be performed on objects.&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;In the following example we are using the toUpperCase() method of the String object to display a text in uppercase letters:&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;table border="0" cellpadding="0" cellspacing="0" class="code" style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;span style="font-size: small;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style="font-size: small;"&gt;&amp;lt;script type="text/javascript"&amp;gt;&lt;br /&gt;var str="Hello world!";&lt;br /&gt;document.write(str.toUpperCase());&lt;br /&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style="font-size: small;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;The output of the code above will be:&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;span style="font-size: small;"&gt;&lt;span style="font-family: Arial,Helvetica,sans-serif;"&gt;HELLO WORLD!&lt;/span&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8707790305856929068-4724705545873505206?l=javascriptfactory.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javascriptfactory.blogspot.com/feeds/4724705545873505206/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://javascriptfactory.blogspot.com/2009/10/javascript-methods.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8707790305856929068/posts/default/4724705545873505206'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8707790305856929068/posts/default/4724705545873505206'/><link rel='alternate' type='text/html' href='http://javascriptfactory.blogspot.com/2009/10/javascript-methods.html' title='javascript : Methods'/><author><name>Vipin C</name><uri>http://www.blogger.com/profile/01967245433419006643</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8707790305856929068.post-4982560147195736035</id><published>2009-10-07T06:32:00.000-07:00</published><updated>2009-10-07T06:32:55.675-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='OOPS'/><title type='text'>Javascript : Properties</title><content type='html'>&lt;span style="font-size: small;"&gt;&lt;/span&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;Properties are the values associated with an object.&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;In the following example we are using the length property of the String object to return the number of characters in a string:&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;table border="0" cellpadding="0" cellspacing="0" class="code" style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;br /&gt;&lt;/td&gt;&lt;td&gt;&lt;br /&gt;&lt;/td&gt;&lt;td&gt;&lt;span style="font-size: small;"&gt;&amp;lt;script type="text/javascript"&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: small;"&gt;var txt="Hello World!";&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: small;"&gt;document.write(txt.length);&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: small;"&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;The output of the code above will be:&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;12&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8707790305856929068-4982560147195736035?l=javascriptfactory.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javascriptfactory.blogspot.com/feeds/4982560147195736035/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://javascriptfactory.blogspot.com/2009/10/javascript-properties.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8707790305856929068/posts/default/4982560147195736035'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8707790305856929068/posts/default/4982560147195736035'/><link rel='alternate' type='text/html' href='http://javascriptfactory.blogspot.com/2009/10/javascript-properties.html' title='Javascript : Properties'/><author><name>Vipin C</name><uri>http://www.blogger.com/profile/01967245433419006643</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8707790305856929068.post-827485771095966275</id><published>2009-10-07T06:31:00.000-07:00</published><updated>2009-10-07T06:31:14.802-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='OOPS'/><title type='text'>Javascript : Object Oriented Programming</title><content type='html'>&lt;span style="font-size: small;"&gt;&lt;/span&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;JavaScript is an Object Oriented Programming (OOP) language. An OOP language allows you to define your own objects and make your own variable types.&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;However, creating your own objects will be explained later, in the Advanced JavaScript section. We will start by looking at the built-in JavaScript objects, and how they are used. The next pages will explain each built-in JavaScript object in detail.&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;Note that an object is just a special kind of data. An object has properties and methods.&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8707790305856929068-827485771095966275?l=javascriptfactory.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javascriptfactory.blogspot.com/feeds/827485771095966275/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://javascriptfactory.blogspot.com/2009/10/javascript-object-oriented-programming.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8707790305856929068/posts/default/827485771095966275'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8707790305856929068/posts/default/827485771095966275'/><link rel='alternate' type='text/html' href='http://javascriptfactory.blogspot.com/2009/10/javascript-object-oriented-programming.html' title='Javascript : Object Oriented Programming'/><author><name>Vipin C</name><uri>http://www.blogger.com/profile/01967245433419006643</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8707790305856929068.post-5499634066508809479</id><published>2009-10-07T06:30:00.001-07:00</published><updated>2009-10-07T06:30:36.517-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='OOPS'/><title type='text'>JavaScript Objects Introduction</title><content type='html'>&lt;span style="font-size: small;"&gt;&lt;/span&gt;&lt;div class="intro" style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;JavaScript is an Object Oriented Programming (OOP) language.&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="intro" style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;An OOP language allows you to define your own objects and make your own variable types.&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8707790305856929068-5499634066508809479?l=javascriptfactory.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javascriptfactory.blogspot.com/feeds/5499634066508809479/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://javascriptfactory.blogspot.com/2009/10/javascript-objects-introduction.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8707790305856929068/posts/default/5499634066508809479'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8707790305856929068/posts/default/5499634066508809479'/><link rel='alternate' type='text/html' href='http://javascriptfactory.blogspot.com/2009/10/javascript-objects-introduction.html' title='JavaScript Objects Introduction'/><author><name>Vipin C</name><uri>http://www.blogger.com/profile/01967245433419006643</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8707790305856929068.post-4321358341461241503</id><published>2009-09-22T04:30:00.000-07:00</published><updated>2009-09-22T04:30:45.502-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Javascript Guidelines'/><title type='text'>JavaScript Guidelines</title><content type='html'>&lt;span style="font-size: small;"&gt;&lt;/span&gt;&lt;div class="intro" style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;Some other important things to know when scripting with JavaScript.&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;hr style="font-family: Arial,Helvetica,sans-serif;" /&gt;  &lt;h2 style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;JavaScript is Case Sensitive&lt;/span&gt;&lt;/h2&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;A function named "myfunction" is not the same as "myFunction" and a variable named "myVar" is not the same as "myvar".&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;JavaScript is case sensitive - therefore watch your capitalization closely when you create or call variables, objects and functions.&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;hr style="font-family: Arial,Helvetica,sans-serif;" /&gt;  &lt;h2 style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;White Space&lt;/span&gt;&lt;/h2&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;JavaScript ignores extra spaces. You can add white space to your script to make it more readable. The following lines are equivalent:&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;blockquote style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;table border="0" cellpadding="0" cellspacing="0" class="code"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;span style="font-size: small;"&gt; name="Hege";&lt;br /&gt;name = "Hege";&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/blockquote&gt;&lt;span style="font-size: small;"&gt;&lt;br style="font-family: Arial,Helvetica,sans-serif;" /&gt;&lt;/span&gt; &lt;hr style="font-family: Arial,Helvetica,sans-serif;" /&gt;  &lt;h2 style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;Break up a Code Line&lt;/span&gt;&lt;/h2&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;You can break up a code line &lt;b&gt;within a text string&lt;/b&gt; with a backslash. The example below will be displayed properly:&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;blockquote style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;table border="0" cellpadding="0" cellspacing="0" class="code"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;span style="font-size: small;"&gt; document.write("Hello \&lt;br /&gt;World!")&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;span style="font-size: small;"&gt;However, you cannot break up a code line like this:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: small;"&gt; document.write \&lt;br /&gt;("Hello World!");&lt;/span&gt;&lt;/blockquote&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8707790305856929068-4321358341461241503?l=javascriptfactory.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javascriptfactory.blogspot.com/feeds/4321358341461241503/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://javascriptfactory.blogspot.com/2009/09/javascript-guidelines.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8707790305856929068/posts/default/4321358341461241503'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8707790305856929068/posts/default/4321358341461241503'/><link rel='alternate' type='text/html' href='http://javascriptfactory.blogspot.com/2009/09/javascript-guidelines.html' title='JavaScript Guidelines'/><author><name>Vipin C</name><uri>http://www.blogger.com/profile/01967245433419006643</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8707790305856929068.post-8113697087208974566</id><published>2009-09-22T04:28:00.000-07:00</published><updated>2009-09-22T04:28:46.330-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Special Characters'/><category scheme='http://www.blogger.com/atom/ns#' term='Tutorials'/><title type='text'>JavaScript Special Characters</title><content type='html'>&lt;span style="font-size: small;"&gt;&lt;/span&gt;&lt;div class="intro" style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;In JavaScript you can add special characters to a text string by using the backslash sign.&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;hr style="font-family: Arial,Helvetica,sans-serif;" /&gt;  &lt;h2 style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;Insert Special Characters&lt;/span&gt;&lt;/h2&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;The backslash (\) is used to insert apostrophes, new lines, quotes, and other special characters into a text string.&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;Look at the following JavaScript code:&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;table border="0" cellpadding="0" cellspacing="0" class="code" style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt; &lt;span style="font-size: x-small;"&gt;&lt;b&gt;var txt="We are the so-called "Vikings" from the north.";&lt;br /&gt;document.write(txt);&lt;/b&gt;&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style="font-size: small;"&gt;&lt;b&gt;&amp;nbsp;&lt;/b&gt;&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style="font-size: small;"&gt;&lt;b&gt;&amp;nbsp;&lt;/b&gt;&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style="font-size: small;"&gt;&lt;b&gt;&amp;nbsp;&lt;/b&gt;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;In JavaScript, a string is started and stopped with either single or double quotes. This means that the string above will be chopped to: We are the so-called&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;To solve this problem, you must place a backslash (\) before each double quote in "Viking". This turns each double quote into a string literal:&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;table border="0" cellpadding="0" cellspacing="0" class="code" style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt; &lt;span style="font-size: x-small;"&gt;&lt;b&gt;var txt="We are the so-called \"Vikings\" from the north.";&lt;br /&gt;document.write(txt);&lt;/b&gt;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;JavaScript will now output the proper text string: We are the so-called "Vikings" from the north.&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;Here is another example:&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;table border="0" cellpadding="0" cellspacing="0" class="code" style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;span style="font-size: x-small;"&gt;&lt;b&gt;document.write ("You \&amp;amp; I are singing!");&lt;/b&gt;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;The example above will produce the following output:&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;table border="0" cellpadding="0" cellspacing="0" class="code" style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;span style="font-size: small;"&gt;You &amp;amp; I are singing!&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;The table below lists other special characters that can be added to a text string with the backslash sign:&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;table border="1" cellpadding="0" cellspacing="0" class="reference" style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;tbody&gt;&lt;tr&gt;   &lt;th align="left"&gt;&lt;span style="font-size: x-small;"&gt;Code&lt;/span&gt;&lt;/th&gt;   &lt;th align="left"&gt;&lt;span style="font-size: x-small;"&gt;Outputs&lt;/span&gt;&lt;/th&gt; &lt;/tr&gt;&lt;tr&gt;   &lt;td&gt;&lt;span style="font-size: small;"&gt;\'&lt;/span&gt;&lt;/td&gt;   &lt;td&gt;&lt;span style="font-size: small;"&gt;single quote&lt;/span&gt;&lt;/td&gt; &lt;/tr&gt;&lt;tr&gt;   &lt;td&gt;&lt;span style="font-size: small;"&gt;\"&lt;/span&gt;&lt;/td&gt;   &lt;td&gt;&lt;span style="font-size: small;"&gt;double quote&lt;/span&gt;&lt;/td&gt; &lt;/tr&gt;&lt;tr&gt;   &lt;td&gt;&lt;span style="font-size: small;"&gt;\&amp;amp;&lt;/span&gt;&lt;/td&gt;   &lt;td&gt;&lt;span style="font-size: small;"&gt;ampersand&lt;/span&gt;&lt;/td&gt; &lt;/tr&gt;&lt;tr&gt;   &lt;td&gt;&lt;span style="font-size: small;"&gt;\\&lt;/span&gt;&lt;/td&gt;   &lt;td&gt;&lt;span style="font-size: small;"&gt;backslash&lt;/span&gt;&lt;/td&gt; &lt;/tr&gt;&lt;tr&gt;   &lt;td&gt;&lt;span style="font-size: small;"&gt;\n&lt;/span&gt;&lt;/td&gt;   &lt;td&gt;&lt;span style="font-size: small;"&gt;new line&lt;/span&gt;&lt;/td&gt; &lt;/tr&gt;&lt;tr&gt;   &lt;td&gt;&lt;span style="font-size: small;"&gt;\r&lt;/span&gt;&lt;/td&gt;   &lt;td&gt;&lt;span style="font-size: small;"&gt;carriage return&lt;/span&gt;&lt;/td&gt; &lt;/tr&gt;&lt;tr&gt;   &lt;td&gt;&lt;span style="font-size: small;"&gt;\t&lt;/span&gt;&lt;/td&gt;   &lt;td&gt;&lt;span style="font-size: small;"&gt;tab&lt;/span&gt;&lt;/td&gt; &lt;/tr&gt;&lt;tr&gt;   &lt;td&gt;&lt;span style="font-size: small;"&gt;\b&lt;/span&gt;&lt;/td&gt;   &lt;td&gt;&lt;span style="font-size: small;"&gt;backspace&lt;/span&gt;&lt;/td&gt; &lt;/tr&gt;&lt;tr&gt;   &lt;td&gt;&lt;span style="font-size: small;"&gt;\f&lt;/span&gt;&lt;/td&gt;   &lt;td&gt;&lt;span style="font-size: small;"&gt;form feed&lt;/span&gt;&lt;/td&gt; &lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8707790305856929068-8113697087208974566?l=javascriptfactory.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javascriptfactory.blogspot.com/feeds/8113697087208974566/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://javascriptfactory.blogspot.com/2009/09/javascript-special-characters.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8707790305856929068/posts/default/8113697087208974566'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8707790305856929068/posts/default/8113697087208974566'/><link rel='alternate' type='text/html' href='http://javascriptfactory.blogspot.com/2009/09/javascript-special-characters.html' title='JavaScript Special Characters'/><author><name>Vipin C</name><uri>http://www.blogger.com/profile/01967245433419006643</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8707790305856929068.post-7526656958353307958</id><published>2009-09-22T04:26:00.000-07:00</published><updated>2009-09-22T04:26:26.627-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Throw Statement'/><category scheme='http://www.blogger.com/atom/ns#' term='Try and Catch'/><category scheme='http://www.blogger.com/atom/ns#' term='Tutorials'/><title type='text'>JavaScript Throw Statement</title><content type='html'>&lt;span style="font-size: small;"&gt;&lt;/span&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;The throw statement allows you to create an exception.&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;h2 style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;The Throw Statement&lt;/span&gt;&lt;/h2&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;The throw statement allows you to create an exception. If you use this statement together with the try...catch statement, you can control program flow and generate accurate error messages.&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;h3 style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;Syntax&lt;/span&gt;&lt;/h3&gt;&lt;table border="0" cellpadding="0" cellspacing="0" class="code" style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;span style="font-size: small;"&gt;throw(exception)&lt;/span&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;The exception can be a string, integer, Boolean or an object.&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;Note that throw is written in lowercase letters. Using uppercase letters will generate a JavaScript error!&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;h3 style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;Example&lt;/span&gt;&lt;/h3&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;The example below determines the value of a variable called x. If the value of x is higher than 10, lower than 0,  or not a number, we are going to throw an error. The error is then caught by the catch argument and the proper error message is displayed:&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&amp;lt;html&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&amp;lt;body&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&amp;lt;script&amp;nbsp;type="text/javascript"&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;var&amp;nbsp;x=prompt("Enter&amp;nbsp;a&amp;nbsp;number&amp;nbsp;between&amp;nbsp;0&amp;nbsp;and&amp;nbsp;10:","");&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;try&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&amp;nbsp;&amp;nbsp;{&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&amp;nbsp;&amp;nbsp;if(x&amp;gt;10)&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;throw&amp;nbsp;"Err1";&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&amp;nbsp;&amp;nbsp;else&amp;nbsp;if(x&amp;lt;0)&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;throw&amp;nbsp;"Err2";&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&amp;nbsp;&amp;nbsp;else&amp;nbsp;if(isNaN(x))&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;throw&amp;nbsp;"Err3";&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&amp;nbsp;&amp;nbsp;}&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;catch(er)&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&amp;nbsp;&amp;nbsp;{&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&amp;nbsp;&amp;nbsp;if(er=="Err1")&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;alert("Error!&amp;nbsp;The&amp;nbsp;value&amp;nbsp;is&amp;nbsp;too&amp;nbsp;high");&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&amp;nbsp;&amp;nbsp;if(er=="Err2")&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;alert("Error!&amp;nbsp;The&amp;nbsp;value&amp;nbsp;is&amp;nbsp;too&amp;nbsp;low");&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&amp;nbsp;&amp;nbsp;if(er=="Err3")&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;alert("Error!&amp;nbsp;The&amp;nbsp;value&amp;nbsp;is&amp;nbsp;not&amp;nbsp;a&amp;nbsp;number");&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&amp;nbsp;&amp;nbsp;}&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8707790305856929068-7526656958353307958?l=javascriptfactory.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javascriptfactory.blogspot.com/feeds/7526656958353307958/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://javascriptfactory.blogspot.com/2009/09/javascript-throw-statement.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8707790305856929068/posts/default/7526656958353307958'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8707790305856929068/posts/default/7526656958353307958'/><link rel='alternate' type='text/html' href='http://javascriptfactory.blogspot.com/2009/09/javascript-throw-statement.html' title='JavaScript Throw Statement'/><author><name>Vipin C</name><uri>http://www.blogger.com/profile/01967245433419006643</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8707790305856929068.post-8595015690986557549</id><published>2009-09-22T04:24:00.001-07:00</published><updated>2009-09-22T04:24:59.459-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Try and Catch'/><category scheme='http://www.blogger.com/atom/ns#' term='Examples'/><title type='text'>Javascript : The try...catch Statement : Example</title><content type='html'>&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;The next example uses a confirm box to display a custom  message telling users they can click OK to continue viewing the page or click  Cancel to go to the homepage. If the confirm method returns false, the user  clicked Cancel, and the code redirects the user. If the confirm  method returns true, the code does nothing:&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&amp;lt;html&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&amp;lt;head&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&amp;lt;script&amp;nbsp;type="text/javascript"&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;var&amp;nbsp;txt=""&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;function&amp;nbsp;message()&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;{&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;try&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&amp;nbsp;&amp;nbsp;{&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&amp;nbsp;&amp;nbsp;adddlert("Welcome&amp;nbsp;guest!");&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&amp;nbsp;&amp;nbsp;}&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;catch(err)&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&amp;nbsp;&amp;nbsp;{&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&amp;nbsp;&amp;nbsp;txt="There&amp;nbsp;was&amp;nbsp;an&amp;nbsp;error&amp;nbsp;on&amp;nbsp;this&amp;nbsp;page.\n\n";&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&amp;nbsp;&amp;nbsp;txt+="Click&amp;nbsp;OK&amp;nbsp;to&amp;nbsp;continue&amp;nbsp;viewing&amp;nbsp;this&amp;nbsp;page,\n";&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&amp;nbsp;&amp;nbsp;txt+="or&amp;nbsp;Cancel&amp;nbsp;to&amp;nbsp;return&amp;nbsp;to&amp;nbsp;the&amp;nbsp;home&amp;nbsp;page.\n\n";&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&amp;nbsp;&amp;nbsp;if(!confirm(txt))&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;document.location.href="http://www.w3schools.com/";&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&amp;nbsp;&amp;nbsp;}&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&amp;lt;body&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&amp;lt;input&amp;nbsp;type="button"&amp;nbsp;value="View&amp;nbsp;message"&amp;nbsp;onclick="message()"&amp;nbsp;/&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8707790305856929068-8595015690986557549?l=javascriptfactory.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javascriptfactory.blogspot.com/feeds/8595015690986557549/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://javascriptfactory.blogspot.com/2009/09/javascript-trycatch-statement-example.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8707790305856929068/posts/default/8595015690986557549'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8707790305856929068/posts/default/8595015690986557549'/><link rel='alternate' type='text/html' href='http://javascriptfactory.blogspot.com/2009/09/javascript-trycatch-statement-example.html' title='Javascript : The try...catch Statement : Example'/><author><name>Vipin C</name><uri>http://www.blogger.com/profile/01967245433419006643</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8707790305856929068.post-998538192655080430</id><published>2009-09-22T04:23:00.000-07:00</published><updated>2009-09-22T04:23:27.493-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Try and Catch'/><category scheme='http://www.blogger.com/atom/ns#' term='Tutorials'/><category scheme='http://www.blogger.com/atom/ns#' term='Examples'/><title type='text'>Javascript : The try...catch Statement</title><content type='html'>&lt;span style="font-size: small;"&gt;&lt;/span&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;The try...catch statement allows you to test a block of code for errors. The try block contains the code to be run, and the catch block contains the code to be executed if an error occurs.&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;h3 style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;Syntax&lt;/span&gt;&lt;/h3&gt;&lt;table border="0" cellpadding="0" cellspacing="0" class="code" style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;span style="font-size: small;"&gt; try&lt;br /&gt;&amp;nbsp; {&lt;br /&gt;&amp;nbsp; //Run some code here&lt;br /&gt;&amp;nbsp; }&lt;br /&gt;catch(err)&lt;br /&gt;&amp;nbsp; {&lt;br /&gt;&amp;nbsp; //Handle errors here&lt;br /&gt;&amp;nbsp; }&lt;/span&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;Note that try...catch is written in lowercase letters. Using uppercase letters will generate a JavaScript error!&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;h2 class="example" style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;Example &lt;br /&gt;&lt;/span&gt;&lt;/h2&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&amp;lt;html&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: small;"&gt;&amp;lt;head&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: small;"&gt;&amp;lt;script&amp;nbsp;type="text/javascript"&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: small;"&gt;var&amp;nbsp;txt=""&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: small;"&gt;function&amp;nbsp;message()&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: small;"&gt;{&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: small;"&gt;try&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: small;"&gt;&amp;nbsp;&amp;nbsp;{&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: small;"&gt;&amp;nbsp;&amp;nbsp;adddlert("Welcome&amp;nbsp;guest!");&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: small;"&gt;&amp;nbsp;&amp;nbsp;}&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: small;"&gt;catch(err)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: small;"&gt;&amp;nbsp;&amp;nbsp;{&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: small;"&gt;&amp;nbsp;&amp;nbsp;txt="There&amp;nbsp;was&amp;nbsp;an&amp;nbsp;error&amp;nbsp;on&amp;nbsp;this&amp;nbsp;page.\n\n";&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: small;"&gt;&amp;nbsp;&amp;nbsp;txt+="Error&amp;nbsp;description:&amp;nbsp;"&amp;nbsp;+&amp;nbsp;err.description&amp;nbsp;+&amp;nbsp;"\n\n";&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: small;"&gt;&amp;nbsp;&amp;nbsp;txt+="Click&amp;nbsp;OK&amp;nbsp;to&amp;nbsp;continue.\n\n";&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: small;"&gt;&amp;nbsp;&amp;nbsp;alert(txt);&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: small;"&gt;&amp;nbsp;&amp;nbsp;}&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: small;"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: small;"&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: small;"&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: small;"&gt;&amp;lt;body&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: small;"&gt;&amp;lt;input&amp;nbsp;type="button"&amp;nbsp;value="View&amp;nbsp;message"&amp;nbsp;onclick="message()"&amp;nbsp;/&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: small;"&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: small;"&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8707790305856929068-998538192655080430?l=javascriptfactory.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javascriptfactory.blogspot.com/feeds/998538192655080430/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://javascriptfactory.blogspot.com/2009/09/javascript-trycatch-statement.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8707790305856929068/posts/default/998538192655080430'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8707790305856929068/posts/default/998538192655080430'/><link rel='alternate' type='text/html' href='http://javascriptfactory.blogspot.com/2009/09/javascript-trycatch-statement.html' title='Javascript : The try...catch Statement'/><author><name>Vipin C</name><uri>http://www.blogger.com/profile/01967245433419006643</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8707790305856929068.post-2948483634213014826</id><published>2009-09-22T04:21:00.000-07:00</published><updated>2009-09-22T04:21:43.318-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Statements'/><category scheme='http://www.blogger.com/atom/ns#' term='Try and Catch'/><category scheme='http://www.blogger.com/atom/ns#' term='Tutorials'/><title type='text'>JavaScript - Catching Errors</title><content type='html'>&lt;span style="font-size: small;"&gt;&lt;/span&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;When browsing Web pages on the internet, we all have seen a JavaScript alert box telling us there is a runtime error and asking "Do you wish to debug?". Error message like this may be useful for developers but not for users. When users see errors, they often leave the Web page.&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;The try...catch statement allows you to test a block of code  for errors.&lt;br /&gt;&lt;/span&gt; &lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8707790305856929068-2948483634213014826?l=javascriptfactory.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javascriptfactory.blogspot.com/feeds/2948483634213014826/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://javascriptfactory.blogspot.com/2009/09/javascript-catching-errors.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8707790305856929068/posts/default/2948483634213014826'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8707790305856929068/posts/default/2948483634213014826'/><link rel='alternate' type='text/html' href='http://javascriptfactory.blogspot.com/2009/09/javascript-catching-errors.html' title='JavaScript - Catching Errors'/><author><name>Vipin C</name><uri>http://www.blogger.com/profile/01967245433419006643</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8707790305856929068.post-8303997397725505604</id><published>2009-09-22T04:20:00.000-07:00</published><updated>2009-09-22T04:20:24.726-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Events'/><category scheme='http://www.blogger.com/atom/ns#' term='Tutorials'/><title type='text'>Javascript : onMouseOver and onMouseOut Events</title><content type='html'>&lt;span style="font-size: small;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;onMouseOver and onMouseOut are often used to create "animated" buttons.&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;Below is an example of an onMouseOver event. An alert box appears when an onMouseOver event is detected:&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;b&gt;&lt;span style="font-size: small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;&lt;/div&gt;&lt;b&gt;&amp;lt;a&amp;nbsp;href="http://www.w3schools.com"&amp;nbsp;onmouseover="alert('An&amp;nbsp;onMouseOver&amp;nbsp;event');return&amp;nbsp;false"&amp;gt;&amp;lt;img&amp;nbsp;src="w3s.gif"&amp;nbsp;alt="W3Schools"&amp;nbsp;/&amp;gt;&amp;lt;/a&amp;gt;&lt;/b&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8707790305856929068-8303997397725505604?l=javascriptfactory.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javascriptfactory.blogspot.com/feeds/8303997397725505604/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://javascriptfactory.blogspot.com/2009/09/javascript-onmouseover-and-onmouseout.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8707790305856929068/posts/default/8303997397725505604'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8707790305856929068/posts/default/8303997397725505604'/><link rel='alternate' type='text/html' href='http://javascriptfactory.blogspot.com/2009/09/javascript-onmouseover-and-onmouseout.html' title='Javascript : onMouseOver and onMouseOut Events'/><author><name>Vipin C</name><uri>http://www.blogger.com/profile/01967245433419006643</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8707790305856929068.post-3249257048814540580</id><published>2009-09-22T04:19:00.000-07:00</published><updated>2009-09-22T04:19:05.262-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Events'/><category scheme='http://www.blogger.com/atom/ns#' term='Tutorials'/><title type='text'>Javascript : onSubmit Event</title><content type='html'>&lt;span style="font-size: small;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;The onSubmit event is used to validate ALL form fields before submitting it.&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;Below is an example of how to use the onSubmit event. The checkForm() function will be called when the user clicks the submit button in the form. If the field values are not accepted, the submit should be cancelled. The function checkForm() returns either true or false. If it returns true the form will be submitted, otherwise the submit will be cancelled:&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;span style="font-size: small;"&gt;&lt;span style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;b&gt;&amp;lt;form&amp;nbsp;method="post"&amp;nbsp;action="xxx.htm"&amp;nbsp;onsubmit="return&amp;nbsp;checkForm()"&amp;gt;&lt;/b&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8707790305856929068-3249257048814540580?l=javascriptfactory.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javascriptfactory.blogspot.com/feeds/3249257048814540580/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://javascriptfactory.blogspot.com/2009/09/javascript-onsubmit-event.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8707790305856929068/posts/default/3249257048814540580'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8707790305856929068/posts/default/3249257048814540580'/><link rel='alternate' type='text/html' href='http://javascriptfactory.blogspot.com/2009/09/javascript-onsubmit-event.html' title='Javascript : onSubmit Event'/><author><name>Vipin C</name><uri>http://www.blogger.com/profile/01967245433419006643</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8707790305856929068.post-894379997153461213</id><published>2009-09-22T04:17:00.000-07:00</published><updated>2009-09-22T04:17:43.072-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Events'/><category scheme='http://www.blogger.com/atom/ns#' term='Tutorials'/><title type='text'>Javascript : onFocus, onBlur and onChange events</title><content type='html'>&lt;span style="font-size: small;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;The onFocus, onBlur and onChange events are often used in combination with validation of form fields.&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;Below is an example of how to use the onChange event. The checkEmail() function will be called whenever the user changes the content of the field:&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;b&gt;&lt;span style="font-size: small;"&gt;&lt;span style="font-family: Arial,Helvetica,sans-serif;"&gt;&amp;lt;input&amp;nbsp;type="text"&amp;nbsp;size="30"&amp;nbsp;id="email"&amp;nbsp;onchange="checkEmail()"&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8707790305856929068-894379997153461213?l=javascriptfactory.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javascriptfactory.blogspot.com/feeds/894379997153461213/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://javascriptfactory.blogspot.com/2009/09/javascript-onfocus-onblur-and-onchange.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8707790305856929068/posts/default/894379997153461213'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8707790305856929068/posts/default/894379997153461213'/><link rel='alternate' type='text/html' href='http://javascriptfactory.blogspot.com/2009/09/javascript-onfocus-onblur-and-onchange.html' title='Javascript : onFocus, onBlur and onChange events'/><author><name>Vipin C</name><uri>http://www.blogger.com/profile/01967245433419006643</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8707790305856929068.post-449292861588914353</id><published>2009-09-22T04:16:00.000-07:00</published><updated>2009-09-22T04:16:16.682-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Events'/><category scheme='http://www.blogger.com/atom/ns#' term='Tutorials'/><title type='text'>Javascript onLoad and onUnload Events</title><content type='html'>&lt;span style="font-size: small;"&gt;&lt;/span&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;The onLoad and onUnload events are triggered when the user enters or leaves the page.&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;The onLoad event is often used to check the visitor's browser type and browser version, and load the proper version of the web page based on the information.&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;Both the onLoad and onUnload events are also often used to deal with cookies that should be set when a user enters or leaves a page. For example, you could have a popup asking for the user's name upon his first arrival to your page. The name is then stored in a cookie. Next time the visitor arrives at your page, you could have another popup saying something like: "Welcome John Doe!".&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8707790305856929068-449292861588914353?l=javascriptfactory.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javascriptfactory.blogspot.com/feeds/449292861588914353/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://javascriptfactory.blogspot.com/2009/09/javascript-onload-and-onunload-events.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8707790305856929068/posts/default/449292861588914353'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8707790305856929068/posts/default/449292861588914353'/><link rel='alternate' type='text/html' href='http://javascriptfactory.blogspot.com/2009/09/javascript-onload-and-onunload-events.html' title='Javascript onLoad and onUnload Events'/><author><name>Vipin C</name><uri>http://www.blogger.com/profile/01967245433419006643</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8707790305856929068.post-4099717980140015635</id><published>2009-09-22T03:28:00.000-07:00</published><updated>2009-09-22T03:28:27.811-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Events'/><category scheme='http://www.blogger.com/atom/ns#' term='Tutorials'/><title type='text'>JavaScript Events</title><content type='html'>&lt;span style="font-size: small;"&gt;&lt;/span&gt;&lt;div class="intro" style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;Events are actions that can be detected by JavaScript.&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;hr style="font-family: Arial,Helvetica,sans-serif;" /&gt;  &lt;h2 style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;Events&lt;/span&gt;&lt;/h2&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;By using JavaScript, we have the ability to create dynamic web pages. Events are actions that can be detected by JavaScript.&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;Every element on a web page has certain events which can trigger a JavaScript. For example, we can use the onClick event of a button element to indicate that a function will run when a user clicks on the button. We define the events in the HTML tags.&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;Examples of events:&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;ul style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;li&gt;&lt;span style="font-size: small;"&gt;A mouse click&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size: small;"&gt;A web page or an image loading&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size: small;"&gt;Mousing over a hot spot on the web page&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size: small;"&gt;Selecting an input field in an HTML form&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size: small;"&gt;Submitting an HTML form&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size: small;"&gt;A keystroke &lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&lt;b&gt;Note:&lt;/b&gt; Events are normally used in combination with functions, and the function will not be executed before the event occurs!&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8707790305856929068-4099717980140015635?l=javascriptfactory.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javascriptfactory.blogspot.com/feeds/4099717980140015635/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://javascriptfactory.blogspot.com/2009/09/javascript-events.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8707790305856929068/posts/default/4099717980140015635'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8707790305856929068/posts/default/4099717980140015635'/><link rel='alternate' type='text/html' href='http://javascriptfactory.blogspot.com/2009/09/javascript-events.html' title='JavaScript Events'/><author><name>Vipin C</name><uri>http://www.blogger.com/profile/01967245433419006643</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8707790305856929068.post-2590711858149905704</id><published>2009-09-22T03:25:00.000-07:00</published><updated>2009-09-22T03:25:42.521-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Statements'/><category scheme='http://www.blogger.com/atom/ns#' term='Tutorials'/><category scheme='http://www.blogger.com/atom/ns#' term='For in'/><title type='text'>JavaScript For...In Statement</title><content type='html'>&lt;span style="font-size: small;"&gt;&lt;/span&gt;&lt;span style="font-family: Arial,Helvetica,sans-serif; font-size: small;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;The for...in statement loops through the elements of an array or through the properties of an object.&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;h3 style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;Syntax&lt;/span&gt;&lt;/h3&gt;&lt;table border="0" cellpadding="0" cellspacing="0" class="code" style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;span style="font-size: small;"&gt;for (&lt;i&gt;variable&lt;/i&gt; in &lt;i&gt;object&lt;/i&gt;)&lt;br /&gt;&amp;nbsp; {&lt;br /&gt;&lt;i&gt;&amp;nbsp; code to be executed&lt;/i&gt;&lt;br /&gt;&amp;nbsp; }&lt;/span&gt;     &lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&lt;b&gt;Note: &lt;/b&gt;The code in the body of the for...in loop is executed once for each element/property.&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&lt;b&gt;Note: &lt;/b&gt;The variable argument can be a named variable, an array element, or a property of an object.&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;h3 style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;Example&lt;/span&gt;&lt;/h3&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;Use the for...in statement to loop through an array:&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;h2 class="example" style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;Example&lt;/span&gt;&lt;/h2&gt;&amp;lt;html&amp;gt;&lt;br /&gt;&amp;lt;body&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;script&amp;nbsp;type="text/javascript"&amp;gt;&lt;br /&gt;var&amp;nbsp;x;&lt;br /&gt;var&amp;nbsp;mycars&amp;nbsp;=&amp;nbsp;new&amp;nbsp;Array();&lt;br /&gt;mycars[0]&amp;nbsp;=&amp;nbsp;"Saab";&lt;br /&gt;mycars[1]&amp;nbsp;=&amp;nbsp;"Volvo";&lt;br /&gt;mycars[2]&amp;nbsp;=&amp;nbsp;"BMW";&lt;br /&gt;&lt;br /&gt;for&amp;nbsp;(x&amp;nbsp;in&amp;nbsp;mycars)&lt;br /&gt;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;document.write(mycars[x]&amp;nbsp;+&amp;nbsp;"&amp;lt;br&amp;nbsp;/&amp;gt;");&lt;br /&gt;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;&amp;lt;/script&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;/body&amp;gt;&lt;br /&gt;&amp;lt;/html&amp;gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8707790305856929068-2590711858149905704?l=javascriptfactory.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javascriptfactory.blogspot.com/feeds/2590711858149905704/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://javascriptfactory.blogspot.com/2009/09/javascript-forin-statement.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8707790305856929068/posts/default/2590711858149905704'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8707790305856929068/posts/default/2590711858149905704'/><link rel='alternate' type='text/html' href='http://javascriptfactory.blogspot.com/2009/09/javascript-forin-statement.html' title='JavaScript For...In Statement'/><author><name>Vipin C</name><uri>http://www.blogger.com/profile/01967245433419006643</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8707790305856929068.post-142425075604741210</id><published>2009-09-22T03:23:00.001-07:00</published><updated>2009-09-22T03:23:58.264-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Continue'/><category scheme='http://www.blogger.com/atom/ns#' term='Statements'/><category scheme='http://www.blogger.com/atom/ns#' term='Tutorials'/><title type='text'>Javascript continue Statement</title><content type='html'>&lt;span style="font-size: small;"&gt;&lt;/span&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;The continue statement will break the current loop and continue with the next value&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;h2 class="example" style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;Example&lt;/span&gt;&lt;/h2&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;.&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&amp;lt;html&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&amp;lt;body&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&amp;lt;script&amp;nbsp;type="text/javascript"&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;var&amp;nbsp;i=0&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;for&amp;nbsp;(i=0;i&amp;lt;=10;i++)&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&amp;nbsp;&amp;nbsp;{&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&amp;nbsp;&amp;nbsp;if&amp;nbsp;(i==3)&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;continue;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&amp;nbsp;&amp;nbsp;document.write("The&amp;nbsp;number&amp;nbsp;is&amp;nbsp;"&amp;nbsp;+&amp;nbsp;i);&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&amp;nbsp;&amp;nbsp;document.write("&amp;lt;br&amp;nbsp;/&amp;gt;");&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&amp;nbsp;&amp;nbsp;}&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8707790305856929068-142425075604741210?l=javascriptfactory.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javascriptfactory.blogspot.com/feeds/142425075604741210/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://javascriptfactory.blogspot.com/2009/09/javascript-continue-statement.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8707790305856929068/posts/default/142425075604741210'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8707790305856929068/posts/default/142425075604741210'/><link rel='alternate' type='text/html' href='http://javascriptfactory.blogspot.com/2009/09/javascript-continue-statement.html' title='Javascript continue Statement'/><author><name>Vipin C</name><uri>http://www.blogger.com/profile/01967245433419006643</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8707790305856929068.post-1614872439005383708</id><published>2009-09-22T03:22:00.000-07:00</published><updated>2009-09-22T03:22:39.327-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Statements'/><category scheme='http://www.blogger.com/atom/ns#' term='Break'/><category scheme='http://www.blogger.com/atom/ns#' term='Tutorials'/><title type='text'>Javascript break Statement</title><content type='html'>&lt;span style="font-size: small;"&gt;&lt;/span&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;The break statement will break the loop and continue executing the code that follows after the loop (if any).&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;h2 class="example" style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;Example&lt;/span&gt;&lt;/h2&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&amp;lt;html&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&amp;lt;body&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&amp;lt;script&amp;nbsp;type="text/javascript"&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;var&amp;nbsp;i=0;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;for&amp;nbsp;(i=0;i&amp;lt;=10;i++)&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&amp;nbsp;&amp;nbsp;{&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&amp;nbsp;&amp;nbsp;if&amp;nbsp;(i==3)&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;break;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&amp;nbsp;&amp;nbsp;document.write("The&amp;nbsp;number&amp;nbsp;is&amp;nbsp;"&amp;nbsp;+&amp;nbsp;i);&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&amp;nbsp;&amp;nbsp;document.write("&amp;lt;br&amp;nbsp;/&amp;gt;");&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&amp;nbsp;&amp;nbsp;}&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8707790305856929068-1614872439005383708?l=javascriptfactory.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javascriptfactory.blogspot.com/feeds/1614872439005383708/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://javascriptfactory.blogspot.com/2009/09/javascript-break-statement.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8707790305856929068/posts/default/1614872439005383708'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8707790305856929068/posts/default/1614872439005383708'/><link rel='alternate' type='text/html' href='http://javascriptfactory.blogspot.com/2009/09/javascript-break-statement.html' title='Javascript break Statement'/><author><name>Vipin C</name><uri>http://www.blogger.com/profile/01967245433419006643</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8707790305856929068.post-4768030733792365740</id><published>2009-09-16T07:57:00.000-07:00</published><updated>2009-09-16T07:57:37.568-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Ajax'/><category scheme='http://www.blogger.com/atom/ns#' term='XML'/><category scheme='http://www.blogger.com/atom/ns#' term='javascript XML'/><title type='text'>How To Load And Parse XML Data Without ActiveX</title><content type='html'>&lt;span style="font-size: small;"&gt;&lt;/span&gt;&lt;div class="post-text" style="font-family: Arial,Helvetica,sans-serif;"&gt; &lt;span style="font-size: small;"&gt;A little known but cool feature of Internet Explorer is its support for &lt;a href="http://msdn.microsoft.com/workshop/author/dhtml/reference/objects/xml.asp"&gt;&lt;abbr&gt;XML&lt;/abbr&gt; data islands&lt;/a&gt;. Basically, you can embed some &lt;abbr title="eXtensible Markup Language"&gt;XML&lt;/abbr&gt; data in a page like this:&lt;/span&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;pre class="html highlight"&gt;&lt;span style="font-size: small;"&gt;&amp;lt;&lt;span class="tag"&gt;html&lt;/span&gt;&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;lt;&lt;span class="tag"&gt;head&lt;/span&gt;&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;lt;&lt;span class="tag"&gt;xml&lt;/span&gt;&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;&lt;span class="tag"&gt;root&lt;/span&gt;&amp;gt;Some dataroot&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;xml&amp;gt;&lt;br /&gt;&amp;nbsp;head&amp;gt;&lt;br /&gt;&lt;/span&gt;&lt;/pre&gt;&lt;/blockquote&gt;&lt;span style="font-size: small;"&gt;Even cooler, you can reference an external data source:&lt;/span&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;pre class="html highlight"&gt;&lt;span style="font-size: small;"&gt;&amp;lt;&lt;span class="tag"&gt;xml&lt;/span&gt; &lt;span class="attribute"&gt;src&lt;/span&gt;=&lt;span class="attribute value"&gt;"data.xml"&lt;/span&gt;&amp;gt;xml&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;/blockquote&gt;&lt;pre class="html highlight"&gt;&lt;span style="font-size: small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/pre&gt;&lt;span style="font-size: small;"&gt;The classic “Ajax” way to load &lt;abbr&gt;XML&lt;/abbr&gt; data involves a couple of ActiveX objects:&lt;/span&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;pre class="javascript highlight"&gt;&lt;span style="font-size: small;"&gt;&lt;span class="keyword"&gt;var&lt;/span&gt; http = &lt;span class="keyword"&gt;new&lt;/span&gt; ActiveXObject(&lt;span class="string"&gt;"Microsoft.XMLHTTP"&lt;/span&gt;);&lt;br /&gt;http.open(&lt;span class="string"&gt;"GET"&lt;/span&gt;, &lt;span class="string"&gt;"data.xml"&lt;/span&gt;, &lt;span class="keyword"&gt;false&lt;/span&gt;);&lt;br /&gt;http.send(&lt;span class="keyword"&gt;null&lt;/span&gt;);&lt;br /&gt;&lt;span class="keyword"&gt;var&lt;/span&gt; xmlDocument = http.responseXML;&lt;br /&gt;&lt;/span&gt;&lt;/pre&gt;&lt;/blockquote&gt;&lt;span style="font-size: small;"&gt;&lt;code&gt;responseXML&lt;/code&gt; is a &lt;a href="http://www.quirksmode.org/blog/archives/2005/09/xmlhttp_notes_r.html"&gt;tricky beast&lt;/a&gt;, on most platforms it refers to an &lt;abbr&gt;XML&lt;/abbr&gt; document. This means you can do things like access the root node through the &lt;code&gt;documentElement&lt;/code&gt; property. Unfortunately this does not work on Internet Explorer:&lt;/span&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;pre class="javascript highlight"&gt;&lt;span style="font-size: small;"&gt;&lt;span class="special"&gt;alert&lt;/span&gt;(xmlDocument.documentElement);&lt;br /&gt;&lt;span class="comment"&gt;// ==&amp;gt; [object Element] for Mozilla&lt;/span&gt;&lt;br /&gt;&lt;span class="comment"&gt;// ==&amp;gt; null             for Internet Explorer &lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/pre&gt;&lt;/blockquote&gt;&lt;span style="font-size: small;"&gt;To create a true &lt;abbr&gt;XML&lt;/abbr&gt; document for Internet Explorer you must use the &lt;code&gt;responseText&lt;/code&gt; property and another ActiveX object to parse it:&lt;/span&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;pre class="javascript highlight"&gt;&lt;span style="font-size: small;"&gt;&lt;span class="keyword"&gt;var&lt;/span&gt; xmlDocument = &lt;span class="keyword"&gt;new&lt;/span&gt; ActiveXObject(&lt;span class="string"&gt;"Microsoft.XMLDOM"&lt;/span&gt;);&lt;br /&gt;xmlDocument.loadXML(http.responseText);&lt;br /&gt;&lt;/span&gt;&lt;/pre&gt;&lt;span style="font-size: small;"&gt;An easier way to achieve the same result without ActiveX is this:&lt;/span&gt;&lt;br /&gt;&lt;pre class="javascript highlight"&gt;&lt;span style="font-size: small;"&gt;&lt;span class="keyword"&gt;var&lt;/span&gt; xml = &lt;span class="global"&gt;document&lt;/span&gt;.createElement(&lt;span class="string"&gt;"xml"&lt;/span&gt;);&lt;br /&gt;xml.src = &lt;span class="string"&gt;"data.xml"&lt;/span&gt;;&lt;br /&gt;&lt;span class="global"&gt;document&lt;/span&gt;.body.appendChild(xml);&lt;br /&gt;&lt;span class="keyword"&gt;var&lt;/span&gt; xmlDocument = xml.XMLDocument;&lt;br /&gt;&lt;span class="global"&gt;document&lt;/span&gt;.body.removeChild(xml);&lt;br /&gt;&lt;/span&gt;&lt;/pre&gt;&lt;/blockquote&gt;&lt;span style="font-size: small;"&gt;The code above will load and parse an external &lt;abbr&gt;XML&lt;/abbr&gt; file. The resulting object is a true &lt;abbr&gt;XML&lt;/abbr&gt;&lt;code&gt;responseXML&lt;/code&gt; returned by the &lt;code&gt;XMLHttpRequest&lt;/code&gt;&lt;/span&gt; document which can be treated the same as the  object on other platforms.&lt;br /&gt;&lt;span style="font-size: small;"&gt;The above code will only work on a local file system. When dealing with remote data you check the &lt;code&gt;readyState&lt;/code&gt; property to ensure that the data has been fully loaded. You can also trap the &lt;code&gt;onreadystatechange&lt;/code&gt; event as you would for the &lt;code&gt;XMLHttpRequest&lt;/code&gt; object.&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8707790305856929068-4768030733792365740?l=javascriptfactory.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javascriptfactory.blogspot.com/feeds/4768030733792365740/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://javascriptfactory.blogspot.com/2009/09/how-to-load-and-parse-xml-data-without.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8707790305856929068/posts/default/4768030733792365740'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8707790305856929068/posts/default/4768030733792365740'/><link rel='alternate' type='text/html' href='http://javascriptfactory.blogspot.com/2009/09/how-to-load-and-parse-xml-data-without.html' title='How To Load And Parse XML Data Without ActiveX'/><author><name>Vipin C</name><uri>http://www.blogger.com/profile/01967245433419006643</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8707790305856929068.post-2869384159773049040</id><published>2009-09-16T07:46:00.000-07:00</published><updated>2009-09-16T07:46:46.259-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Enum'/><title type='text'>Enum : Enumerating JavaScript Objects</title><content type='html'>&lt;span style="font-size: small;"&gt;&lt;/span&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;Enumeration lies at the heart of &lt;abbr title="Document Object Model"&gt;DOM&lt;/abbr&gt; Scripting:&lt;/span&gt;&lt;/div&gt;&lt;blockquote style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;pre class="javascript highlight"&gt;&lt;span style="font-size: small;"&gt;&lt;span class="keyword"&gt;var&lt;/span&gt; lists = &lt;span class="global"&gt;document&lt;/span&gt;.getElementsByTagName(&lt;span class="string"&gt;"UL"&lt;/span&gt;);&lt;br /&gt;&lt;span class="keyword"&gt;for&lt;/span&gt; (&lt;span class="keyword"&gt;var&lt;/span&gt; i = &lt;span class="number"&gt;0&lt;/span&gt;; i &amp;lt; lists.length; i++) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;lists[i].className = &lt;span class="string"&gt;"menu"&lt;/span&gt;;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;span class="keyword"&gt;for&lt;/span&gt; (&lt;span class="keyword"&gt;var&lt;/span&gt; i = &lt;span class="number"&gt;0&lt;/span&gt;; i &amp;lt; array.length; i++) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;print(array[i]);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;span class="keyword"&gt;for&lt;/span&gt; (&lt;span class="keyword"&gt;var&lt;/span&gt; key &lt;span class="keyword"&gt;in&lt;/span&gt; object) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;print(object[key]);&lt;br /&gt;}&lt;br /&gt;&lt;/span&gt;&lt;/pre&gt;&lt;/blockquote&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;Us JavaScripters are forever writing loops like these. To ease the strain on our keyboards Mozilla recently introduced a handy &lt;code&gt;forEach&lt;/code&gt; method for arrays:&lt;/span&gt;&lt;/div&gt;&lt;pre class="javascript highlight" style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;array.&lt;span class="base2"&gt;forEach&lt;/span&gt;(print);&lt;br /&gt;&lt;/span&gt;&lt;/pre&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;If you don’t understand the code above then go and read the  &lt;a href="http://developer.mozilla.org/en/docs/Core_JavaScript_1.5_Reference:Objects:Array:forEach"&gt;documentation&lt;/a&gt;.&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;That’s fine for arrays but what about DOM node lists?  That’s where most of our loop writing is concentrated. Fortunately, the clever Mozilla developers provide  &lt;a href="http://developer.mozilla.org/en/docs/New_in_JavaScript_1.6#Array_and_String_generics"&gt;generic array methods&lt;/a&gt; to help us:&lt;/span&gt;&lt;/div&gt;&lt;blockquote style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;pre class="javascript highlight"&gt;&lt;span style="font-size: small;"&gt;&lt;span class="keyword"&gt;var&lt;/span&gt; lists = &lt;span class="global"&gt;document&lt;/span&gt;.getElementsByTagName(&lt;span class="string"&gt;"UL"&lt;/span&gt;);&lt;br /&gt;Array.&lt;span class="base2"&gt;forEach&lt;/span&gt;(lists, &lt;span class="keyword"&gt;function&lt;/span&gt;(list) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;list.className = &lt;span class="string"&gt;"menu"&lt;/span&gt;;&lt;br /&gt;});&lt;br /&gt;&lt;/span&gt;&lt;/pre&gt;&lt;/blockquote&gt;&lt;blockquote style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;Cool huh? The &lt;code&gt;Array.forEach&lt;/code&gt; method treats any object passed to it as if it were an array. So long as that object has a &lt;code&gt;length&lt;/code&gt; property then we are OK.&lt;/span&gt;&lt;/blockquote&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;We can easily implement this method for non-Mozilla browsers:&lt;/span&gt;&lt;/div&gt;&lt;blockquote style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;pre class="javascript highlight"&gt;&lt;span style="font-size: small;"&gt;&lt;span class="comment"&gt;// array-like enumeration&lt;/span&gt;&lt;br /&gt;&lt;span class="keyword"&gt;if&lt;/span&gt; (!Array.&lt;span class="base2"&gt;forEach&lt;/span&gt;) { &lt;span class="comment"&gt;// mozilla already supports this&lt;/span&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;Array.&lt;span class="base2"&gt;forEach&lt;/span&gt; = &lt;span class="keyword"&gt;function&lt;/span&gt;(object, block, context) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="keyword"&gt;for&lt;/span&gt; (&lt;span class="keyword"&gt;var&lt;/span&gt; i = &lt;span class="number"&gt;0&lt;/span&gt;; i &amp;lt; object.length; i++) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;block.call(context, object[i], i, object);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;&amp;nbsp;&amp;nbsp;};&lt;br /&gt;}&lt;br /&gt;&lt;/span&gt;&lt;/pre&gt;&lt;/blockquote&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;I’ve been using this technique for enumeration quite a lot recently and I decided to extend the idea:&lt;/span&gt;&lt;/div&gt;&lt;blockquote style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&lt;span class="comment"&gt;// generic enumeration&lt;/span&gt;&lt;br /&gt;Function.&lt;span class="global"&gt;prototype&lt;/span&gt;.&lt;span class="base2"&gt;forEach&lt;/span&gt; = &lt;span class="keyword"&gt;function&lt;/span&gt;(object, block, context) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&lt;span class="keyword"&gt;for&lt;/span&gt; (&lt;span class="keyword"&gt;var&lt;/span&gt; key &lt;span class="keyword"&gt;in&lt;/span&gt; object) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="keyword"&gt;if&lt;/span&gt; (&lt;span class="keyword"&gt;typeof&lt;/span&gt; &lt;span class="keyword"&gt;this&lt;/span&gt;.&lt;span class="global"&gt;prototype&lt;/span&gt;[key] == &lt;span class="string"&gt;"undefined"&lt;/span&gt;) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;block.call(context, object[key], key, object);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;};&lt;br /&gt;&lt;/span&gt;&lt;/blockquote&gt;&lt;pre class="javascript highlight" style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&lt;br /&gt;&lt;span class="comment"&gt;// globally resolve forEach enumeration&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/pre&gt;&lt;blockquote style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&lt;span class="keyword"&gt;var&lt;/span&gt; &lt;span class="base2"&gt;forEach&lt;/span&gt; = &lt;span class="keyword"&gt;function&lt;/span&gt;(object, block, context) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&lt;span class="keyword"&gt;if&lt;/span&gt; (object) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="keyword"&gt;var&lt;/span&gt; resolve = Object; &lt;span class="comment"&gt;// default&lt;/span&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="keyword"&gt;if&lt;/span&gt; (object &lt;span class="keyword"&gt;instanceof&lt;/span&gt; Function) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="comment"&gt;// functions have a "length" property&lt;/span&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;resolve = Function;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;} &lt;span class="keyword"&gt;else&lt;/span&gt; &lt;span class="keyword"&gt;if&lt;/span&gt; (object.&lt;span class="base2"&gt;forEach&lt;/span&gt; &lt;span class="keyword"&gt;instanceof&lt;/span&gt; Function) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="comment"&gt;// the object implements a custom forEach method so use that&lt;/span&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;object.&lt;span class="base2"&gt;forEach&lt;/span&gt;(block, context);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="keyword"&gt;return&lt;/span&gt;;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;} &lt;span class="keyword"&gt;else&lt;/span&gt; &lt;span class="keyword"&gt;if&lt;/span&gt; (&lt;span class="keyword"&gt;typeof&lt;/span&gt; object.length == &lt;span class="string"&gt;"number"&lt;/span&gt;) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="comment"&gt;// the object is array-like&lt;/span&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;resolve = Array;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;resolve.&lt;span class="base2"&gt;forEach&lt;/span&gt;(object, block, context);&lt;br /&gt;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;};&lt;br /&gt;&lt;/span&gt;&lt;/blockquote&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;This allows me to write loops without knowing what kind of object I’m dealing with:&lt;/span&gt;&lt;/div&gt;&lt;blockquote style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;pre class="javascript highlight"&gt;&lt;span style="font-size: small;"&gt;&lt;span class="keyword"&gt;function&lt;/span&gt; printAll() {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&lt;span class="base2"&gt;forEach&lt;/span&gt; (&lt;span class="keyword"&gt;arguments&lt;/span&gt;, &lt;span class="keyword"&gt;function&lt;/span&gt;(object) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="base2"&gt;forEach&lt;/span&gt; (object, print); &lt;br /&gt;&amp;nbsp;&amp;nbsp;});&lt;br /&gt;};&lt;br /&gt;&lt;span class="comment"&gt;// or&lt;/span&gt;&lt;br /&gt;&lt;span class="base2"&gt;forEach&lt;/span&gt; (&lt;span class="global"&gt;document&lt;/span&gt;.links, &lt;span class="keyword"&gt;function&lt;/span&gt;(link) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;link.className = &lt;span class="string"&gt;"super-link"&lt;/span&gt;;&lt;br /&gt;});&lt;br /&gt;&lt;span class="comment"&gt;// or&lt;/span&gt;&lt;br /&gt;&lt;span class="base2"&gt;forEach&lt;/span&gt; ([&lt;span class="number"&gt;1&lt;/span&gt;, &lt;span class="number"&gt;2&lt;/span&gt;, &lt;span class="number"&gt;3&lt;/span&gt;], print);&lt;br /&gt;&lt;span class="base2"&gt;forEach&lt;/span&gt; ({a: &lt;span class="number"&gt;1&lt;/span&gt;, b: &lt;span class="number"&gt;2&lt;/span&gt;, c: &lt;span class="number"&gt;3&lt;/span&gt;}}, print);&lt;br /&gt;&lt;span class="comment"&gt;// etc&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/pre&gt;&lt;/blockquote&gt;&lt;h4 style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;Explanation&lt;/span&gt;&lt;/h4&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;The global &lt;code&gt;forEach&lt;/code&gt; function allows us to enumerate any object according to its type. If the object is array-like (has a length property) then we enumerate it like an array. All other objects are enumerated using the standard &lt;code&gt;for var x in y&lt;/code&gt; mechanism.&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;When enumerating over objects, the discovered keys are compared against &lt;code&gt;Object.prototype&lt;/code&gt;. If the key is defined on the &lt;code&gt;Object&lt;/code&gt; object then it is not enumerated. That means that you cannot enumerate the built-in methods like &lt;code&gt;toString&lt;/code&gt; and &lt;code&gt;valueOf&lt;/code&gt;. &lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;The global &lt;code&gt;forEach&lt;/code&gt; function will delegate the enumeration of functions to &lt;code&gt;Function.forEach&lt;/code&gt;. So, if you choose to enumerate over a &lt;code&gt;Function&lt;/code&gt; object you will skip the built-in methods there too.&lt;/span&gt;&lt;/div&gt;&lt;h4 style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;The Kick-Ass Bit&lt;/span&gt;&lt;/h4&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;Although I’ve defined a &lt;code&gt;forEach&lt;/code&gt; method on &lt;code&gt;Function.prototype&lt;/code&gt; this is never called by the global &lt;code&gt;forEach&lt;/code&gt; function (except when you are enumerating functions).&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;I’ve provided this as a bonus feature. &lt;img alt=":-)" src="http://deanedwards.googlecode.com/svn/trunk/images/smilies/icon_smile.gif" /&gt;  Basically, by calling the &lt;code&gt;forEach&lt;/code&gt; method on a function you can enumerate an object and compare the keys with that function’s prototype.  That means that you will only enumerate custom properties of the object. An example is required:&lt;/span&gt;&lt;/div&gt;&lt;blockquote style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;pre class="javascript highlight"&gt;&lt;span style="font-size: small;"&gt;&lt;span class="comment"&gt;// create a class&lt;/span&gt;&lt;br /&gt;&lt;span class="keyword"&gt;function&lt;/span&gt; Person(name, age) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&lt;span class="keyword"&gt;this&lt;/span&gt;.name = name || &lt;span class="string"&gt;""&lt;/span&gt;;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&lt;span class="keyword"&gt;this&lt;/span&gt;.age = age || &lt;span class="number"&gt;0&lt;/span&gt;;&lt;br /&gt;};&lt;br /&gt;Person.&lt;span class="global"&gt;prototype&lt;/span&gt; = &lt;span class="keyword"&gt;new&lt;/span&gt; Person;&lt;br /&gt;&lt;br /&gt;&lt;span class="comment"&gt;// instantiate the class&lt;/span&gt;&lt;br /&gt;&lt;span class="keyword"&gt;var&lt;/span&gt; fred = &lt;span class="keyword"&gt;new&lt;/span&gt; Person(&lt;span class="string"&gt;"Fred"&lt;/span&gt;, &lt;span class="number"&gt;38&lt;/span&gt;);&lt;br /&gt;&lt;br /&gt;&lt;span class="comment"&gt;// add some custom properties&lt;/span&gt;&lt;br /&gt;fred.language = &lt;span class="string"&gt;"English"&lt;/span&gt;;&lt;br /&gt;fred.wife = &lt;span class="string"&gt;"Wilma"&lt;/span&gt;;&lt;br /&gt;&lt;/span&gt;&lt;/pre&gt;&lt;/blockquote&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;Enumerate using the standard &lt;code&gt;forEach&lt;/code&gt; method:&lt;/span&gt;&lt;/div&gt;&lt;blockquote style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;pre class="javascript highlight"&gt;&lt;span style="font-size: small;"&gt;&lt;span class="base2"&gt;forEach&lt;/span&gt; (fred, print);&lt;br /&gt;&lt;span class="comment"&gt;// =&amp;gt; name: Fred&lt;/span&gt;&lt;br /&gt;&lt;span class="comment"&gt;// =&amp;gt; age: 38&lt;/span&gt;&lt;br /&gt;&lt;span class="comment"&gt;// =&amp;gt; language: English&lt;/span&gt;&lt;br /&gt;&lt;span class="comment"&gt;// =&amp;gt; wife: Wilma&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/pre&gt;&lt;/blockquote&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;Enumerate using the &lt;code&gt;Person.forEach&lt;/code&gt; method:&lt;/span&gt;&lt;/div&gt;&lt;blockquote style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;pre class="javascript highlight"&gt;&lt;span style="font-size: small;"&gt;Person.&lt;span class="base2"&gt;forEach&lt;/span&gt; (fred, print);&lt;br /&gt;&lt;span class="comment"&gt;// =&amp;gt; language: English&lt;/span&gt;&lt;br /&gt;&lt;span class="comment"&gt;// =&amp;gt; wife: Wilma&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/pre&gt;&lt;/blockquote&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;Note that the properties defined on the prototype are not enumerated in the second example.&lt;/span&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8707790305856929068-2869384159773049040?l=javascriptfactory.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javascriptfactory.blogspot.com/feeds/2869384159773049040/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://javascriptfactory.blogspot.com/2009/09/enum-enumerating-javascript-objects.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8707790305856929068/posts/default/2869384159773049040'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8707790305856929068/posts/default/2869384159773049040'/><link rel='alternate' type='text/html' href='http://javascriptfactory.blogspot.com/2009/09/enum-enumerating-javascript-objects.html' title='Enum : Enumerating JavaScript Objects'/><author><name>Vipin C</name><uri>http://www.blogger.com/profile/01967245433419006643</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8707790305856929068.post-6413700678202005182</id><published>2009-09-16T07:34:00.000-07:00</published><updated>2009-09-16T07:34:19.203-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Ajax'/><title type='text'>AJAX : Introduction</title><content type='html'>&lt;span style="font-size: small;"&gt;&lt;/span&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;Asynchronous JavaScript + XML, is not a new technology or a new programming language. It is a term coined in 2005 by Jesse James Garrett, which describes a “new” approach to using a number of existing technologies together, including: HTML or XHTML, Cascading Style Sheets, JavaScript, The Document Object Model, XML, XSLT, and the XMLHttpRequest object. It is a new technique for creating better, faster, and more interactive web applications.&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;When these technologies are combined in the AJAX model, web applications are able to make quick, incremental updates to the user interface without reloading the entire browser page. This makes the application faster and more responsive to user actions. With AJAX, a JavaScript can communicate directly with the server, with the XMLHttpRequest object. With this object, a JavaScript can trade data with a web server, without reloading the page. AJAX uses asynchronous data transfer (HTTP requests) between the browser and the web server, allowing web pages to request small bits of information from the server instead of whole pages. The AJAX technique makes Internet applications smaller, faster and more user-friendly.&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&lt;strong&gt;AJAX is about better Internet-applications&lt;/strong&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;Internet-applications have many benefits over desktop applications; they can reach a larger audience, they are easier to install and support, and easier to develop. However, Internet-applications are not always as “rich” and user-friendly as traditional desktop applications and most Web applications are slow and tedious. In the traditional Web application, the interaction between the customer and the server goes like this:&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;1. Customer accesses Web application&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;2. Server processes request and sends data to the browser while the customer waits&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;3.Customer clicks on a link or interacts with the application&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;4.Server processes request and sends data back to the browser&lt;br /&gt;while the customer waits&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;5. etc…. There is a lot of customer waiting. It’s a model adapted from the Web’s original use as a hypertext medium.&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&lt;strong&gt;How Ajax is Different&lt;/strong&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;An Ajax application eliminates the start-stop-start-stop nature of interaction on the Web by introducing an intermediary — an Ajax engine — between the user and the server. Instead of loading a webpage, at the start of the session, the browser loads an Ajax engine — written in JavaScript and usually tucked away in a hidden frame. This engine is responsible for both rendering the interface the user sees and communicating with the server on the user’s behalf. The Ajax engine allows the user’s interaction with the application to happen asynchronously — independent of communication with the server. So the user is never staring at a blank browser window and an hourglass icon, waiting around for the server to do something&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&lt;strong&gt;Ajax Acts as an Intermediary&lt;/strong&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;The Ajax engine works within the Web browser (through JavaScript and the DOM) to render the Web application and handle any requests that the customer might have of the Web server. The beauty of it is that because the Ajax engine is handling the requests, it can hold most information in the engine itself, while allowing the interaction with the application and the customer to happen asynchronously and independently of any interaction with the server.&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&lt;strong&gt;Asynchronous&lt;/strong&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;This is the key. In standard Web applications, the interaction between the customer and the server is synchronous. This means that one has to happen after the other. If a customer clicks a link, the request is sent to the server, which then sends the results back. With Ajax, the JavaScript that is loaded when the page loads handles most of the basic tasks such as data validation and manipulation, as well as display rendering the Ajax engine handles without a trip to the server. At the same time that it is making display changes for the customer, it is sending data back and forth to the server. But the data transfer is not dependent upon actions of the customer.&lt;/span&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8707790305856929068-6413700678202005182?l=javascriptfactory.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javascriptfactory.blogspot.com/feeds/6413700678202005182/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://javascriptfactory.blogspot.com/2009/09/ajax-introduction.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8707790305856929068/posts/default/6413700678202005182'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8707790305856929068/posts/default/6413700678202005182'/><link rel='alternate' type='text/html' href='http://javascriptfactory.blogspot.com/2009/09/ajax-introduction.html' title='AJAX : Introduction'/><author><name>Vipin C</name><uri>http://www.blogger.com/profile/01967245433419006643</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8707790305856929068.post-1581146740240495430</id><published>2009-09-16T07:16:00.001-07:00</published><updated>2009-09-16T07:16:59.585-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='HTML Forms and Javascript'/><category scheme='http://www.blogger.com/atom/ns#' term='Examples'/><title type='text'>Improving HTML forms with Javascript</title><content type='html'>&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&lt;span class="day style6"&gt;&lt;/span&gt;&lt;/span&gt;          &lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt; &lt;span style="font-size: small;"&gt;&lt;b&gt;Custom checkbox elements&lt;/b&gt;&lt;br /&gt;&lt;img alt="custom checkboxes demo" height="100" src="http://www.javascript-examples.com/content/html-forms/custom-check.gif" width="163" /&gt;&lt;br /&gt;This idea came about from AOL's use of image checkboxes in the recently launched version of their WebMail product as a means of selecting email messages rather than standard checkboxes. The images you see are inserted after each input element who's type attribute is "checkbox" for every form found in the document. The original checkbox has its display set to "none" and all events that are assigned to that checkbox are then assigned to the image. The images are given alt attributes that describe their current status as well.&lt;br /&gt;&lt;/span&gt;  &lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;  &lt;span style="font-size: small;"&gt;&lt;a href="http://www.slayeroffice.com/" target="_blank"&gt;&lt;img src="http://www.javascript-examples.com/images/homepage.png" /&gt;&lt;/a&gt;   &lt;a href="http://slayeroffice.com/code/custom_checkbox/" target="_blank"&gt;&lt;img src="http://www.javascript-examples.com/images/view_demo.png" /&gt;&lt;/a&gt;&lt;/span&gt; &lt;/div&gt;&lt;div class="post" style="font-family: Arial,Helvetica,sans-serif;"&gt; &lt;div class="date"&gt;   &lt;span style="font-size: small;"&gt;&lt;span class="month"&gt;&lt;/span&gt;&lt;span class="day style6"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;           &lt;/div&gt;&lt;span style="font-size: small;"&gt;&lt;b&gt;Scrollable checklists&lt;/b&gt;&lt;br /&gt;&lt;img alt="" src="http://www.javascript-examples.com/content/html-forms/scroll-check.gif" width="height=" /&gt;&lt;br /&gt;An alternative to the select element with enabled multiple attribute. Enjoy scrollable checklists without all the hassle of worrying about deselecting previously-selected options. &lt;br /&gt;This script is compatible with: IE 5.0+, Firefox 0.8+ for Win32 platform and Safari 1.2+, IE 5.2, Camino 8.2+, Netscape 7+, OmniWeb 4.1+, iCab 3.0+ for Apple Macintosh platform. &lt;br /&gt;&lt;/span&gt;  &lt;br /&gt;&lt;span style="font-size: small;"&gt;&lt;a href="http://c82.net/article.php?ID=25" target="_blank"&gt;&lt;img src="http://www.javascript-examples.com/images/homepage.png" /&gt;&lt;/a&gt;   &lt;a href="http://c82.net/samples/checklist-samples.html" target="_blank"&gt;&lt;img src="http://www.javascript-examples.com/images/view_demo.png" /&gt;&lt;/a&gt;&lt;/span&gt; &lt;br /&gt;&lt;/div&gt;&lt;div class="post" style="font-family: Arial,Helvetica,sans-serif;"&gt; &lt;div class="date"&gt;   &lt;span style="font-size: small;"&gt;&lt;span class="month"&gt;&lt;/span&gt;&lt;span class="day style6"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;           &lt;/div&gt;&lt;span style="font-size: small;"&gt;&lt;b&gt;JotForm&lt;/b&gt;&lt;br /&gt;&lt;img alt="" src="http://www.javascript-examples.com/content/html-forms/jotform.gif" width="height=" /&gt;&lt;br /&gt;JotForm is web based WYSIWYG form builder. You can design forms to use somewhere else or design forms and let this service collect the data for you as well. Solution is completely free. JotForm requires a javascript and cookies enabled browser. Currently it is completely tested on Firefox and Internet Explorer. &lt;img alt="" src="http://www.javascript-examples.com/html-forms/" width="height=" /&gt;&lt;br /&gt;DESCR&lt;br /&gt;&lt;/span&gt;  &lt;br /&gt;&lt;span style="font-size: small;"&gt;&lt;a href="http://www.jotform.com/" target="_blank"&gt;&lt;img src="http://www.javascript-examples.com/images/homepage.png" /&gt;&lt;/a&gt;   &lt;a href="http://www.jotform.com/tour" target="_blank"&gt;&lt;img src="http://www.javascript-examples.com/images/view_demo.png" /&gt;&lt;/a&gt;&lt;/span&gt; &lt;br /&gt;&lt;/div&gt;&lt;div class="post" style="font-family: Arial,Helvetica,sans-serif;"&gt; &lt;div class="date"&gt;   &lt;span style="font-size: small;"&gt;&lt;span class="month"&gt;&lt;/span&gt;&lt;span class="day style6"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;           &lt;/div&gt;&lt;span style="font-size: small;"&gt;&lt;b&gt;Styled Form Controls&lt;/b&gt;&lt;br /&gt;&lt;img alt="" src="http://www.javascript-examples.com/content/html-forms/styled-check.gif" width="height=" /&gt;&lt;br /&gt;Typically, textareas, buttons and text fields have been easy enough to style and the functionality to use images as buttons is inherant to HTML. The styled form controls needed to be dynamically inserted into the page using a javascript. No javascript, no change. &lt;br /&gt;formStyle has been tested in the following browsers: Internet Explorer 7 (Beta 1), 100% Compatibility, some cosmetic flicker issues when toggling controls. Mozilla Firefox 1.0.6 - Full compatibility. Netscape Navigator 7.2 - Full compatibility. Netscape 6.0 - Full compatibility. Minor CSS-styling fault in BigOrb example. Opera Browser 8.0 - Full compatibility. &lt;br /&gt;&lt;/span&gt;  &lt;br /&gt;&lt;span style="font-size: small;"&gt;&lt;a href="http://www.dxdec.com/wod/formstyle/index.html" target="_blank"&gt;&lt;img src="http://www.javascript-examples.com/images/homepage.png" /&gt;&lt;/a&gt;   &lt;a href="http://www.dxdec.com/wod/formstyle/index.html#theexample" target="_blank"&gt;&lt;img src="http://www.javascript-examples.com/images/view_demo.png" /&gt;&lt;/a&gt;  &lt;a href="http://www.dxdec.com/mstats/track.asp?mtr=/wod/formStyle/formStyle.zip"&gt;&lt;img src="http://www.javascript-examples.com/images/download.png" /&gt;&lt;/a&gt;&lt;/span&gt; &lt;br /&gt;&lt;/div&gt;&lt;div class="post" style="font-family: Arial,Helvetica,sans-serif;"&gt; &lt;div class="date"&gt;   &lt;span style="font-size: small;"&gt;&lt;span class="month"&gt;&lt;/span&gt;&lt;span class="day style6"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;           &lt;/div&gt;&lt;span style="font-size: small;"&gt;&lt;b&gt;CRIR: Checkbox &amp;amp; Radio Input Replacement&lt;/b&gt;&lt;br /&gt;&lt;img alt="" src="http://www.javascript-examples.com/content/html-forms/crir.gif" width="height=" /&gt;&lt;br /&gt;This combination of JavaScript and CSS will hide checkbox and radio inputs that have a class = "crirHiddenJS", an id, and a proper label tag.&lt;br /&gt;This will allow you to style the label however you wish using CSS, and the actual input control will be hidden. The form will still collect data as it normally would because the label itself will trigger the hidden input control. If javascript is disabled no inputs will be hidden and the form is still be fully functional.&lt;br /&gt;&lt;/span&gt;  &lt;br /&gt;&lt;span style="font-size: small;"&gt;&lt;a href="http://www.chriserwin.com/scripts/crir/" target="_blank"&gt;&lt;img src="http://www.javascript-examples.com/images/homepage.png" /&gt;&lt;/a&gt;   &lt;a href="http://www.chriserwin.com/scripts/crir/sample2.php" target="_blank"&gt;&lt;img src="http://www.javascript-examples.com/images/view_demo.png" /&gt;&lt;/a&gt;  &lt;a href="http://www.chriserwin.com/scripts/crir/CRIR.zip"&gt;&lt;img src="http://www.javascript-examples.com/images/download.png" /&gt;&lt;/a&gt;&lt;/span&gt; &lt;br /&gt;&lt;/div&gt;&lt;div class="post" style="font-family: Arial,Helvetica,sans-serif;"&gt; &lt;div class="date"&gt;   &lt;span style="font-size: small;"&gt;&lt;span class="month"&gt;&lt;/span&gt;&lt;span class="day style6"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;           &lt;/div&gt;&lt;span style="font-size: small;"&gt;&lt;b&gt;wForms - A Javascript Extension to Web Forms&lt;/b&gt;&lt;br /&gt;&lt;img alt="" src="http://www.javascript-examples.com/content/html-forms/wforms.gif" width="height=" /&gt;&lt;br /&gt;wForms is an open-source, unobtrusive javascript library that adds commonly needed behaviors to traditional web forms without the need for any programming skill.&lt;br /&gt;&lt;/span&gt;  &lt;br /&gt;&lt;span style="font-size: small;"&gt;&lt;a href="http://www.formassembly.com/wForms/" target="_blank"&gt;&lt;img src="http://www.javascript-examples.com/images/homepage.png" /&gt;&lt;/a&gt;   &lt;a href="http://www.formassembly.com/wForms/tutorials/custom_validation.php" target="_blank"&gt;&lt;img src="http://www.javascript-examples.com/images/view_demo.png" /&gt;&lt;/a&gt;  &lt;a href="http://www.formassembly.com/wForms/v2.0/package/wforms_pack.js" target="_blank"&gt;&lt;img src="http://www.javascript-examples.com/images/download.png" /&gt;&lt;/a&gt;&lt;/span&gt; &lt;br /&gt;&lt;/div&gt;&lt;div class="post" style="font-family: Arial,Helvetica,sans-serif;"&gt; &lt;div class="date"&gt;   &lt;span style="font-size: small;"&gt;&lt;span class="month"&gt;&lt;/span&gt;&lt;span class="day style6"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;           &lt;/div&gt;&lt;span style="font-size: small;"&gt;&lt;b&gt;Niceforms&lt;/b&gt;&lt;br /&gt;&lt;img alt="" src="http://www.javascript-examples.com/content/html-forms/niceforms.gif" width="height=" /&gt;&lt;br /&gt;Since normal input fields (including radio buttons, checkboxes, textareas, etc) can only be styled to a small degree, we'll just go ahead and hide them while replacing their visual appearance with our own custom look. &lt;br /&gt;It works great in Mozilla(Win) and IE6. There are some display issues on IE5.x and Opera that can be corrected in the next version. &lt;br /&gt;&lt;/span&gt;  &lt;br /&gt;&lt;span style="font-size: small;"&gt;&lt;a href="http://www.badboy.ro/articles/2005-07-23/index.php" target="_blank"&gt;&lt;img src="http://www.javascript-examples.com/images/homepage.png" /&gt;&lt;/a&gt;   &lt;a href="http://www.badboy.ro/assets/articles/niceforms/niceforms.html" target="_blank"&gt;&lt;img src="http://www.javascript-examples.com/images/view_demo.png" /&gt;&lt;/a&gt;  &lt;a href="http://www.badboy.ro/assets/articles/niceforms/niceforms.zip"&gt;&lt;img src="http://www.javascript-examples.com/images/download.png" /&gt;&lt;/a&gt;&lt;/span&gt; &lt;br /&gt;&lt;/div&gt;&lt;div class="post" style="font-family: Arial,Helvetica,sans-serif;"&gt; &lt;div class="date"&gt;   &lt;span style="font-size: small;"&gt;&lt;span class="month"&gt;&lt;/span&gt;&lt;span class="day style6"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;           &lt;/div&gt;&lt;span style="font-size: small;"&gt;&lt;b&gt;Really easy field validation with Prototype&lt;/b&gt;&lt;br /&gt;&lt;img alt="Prototype field validation" src="http://www.javascript-examples.com/content/html-forms/protocheck.gif" width="height=" /&gt;&lt;br /&gt;Robust javascript validation library that is simple to implement and didn't require do any extra work other than creating the form. It is easy with Prototype. &lt;br /&gt;&lt;/span&gt;  &lt;br /&gt;&lt;span style="font-size: small;"&gt;&lt;a href="http://tetlaw.id.au/view/blog/really-easy-field-validation-with-prototype" target="_blank"&gt;&lt;img src="http://www.javascript-examples.com/images/homepage.png" /&gt;&lt;/a&gt;   &lt;a href="http://tetlaw.id.au/upload/dev/validation/valid.html" target="_blank"&gt;&lt;img src="http://www.javascript-examples.com/images/view_demo.png" /&gt;&lt;/a&gt;  &lt;a href="http://tetlaw.id.au/upload/dev/validation/validation1.5.3.zip"&gt;&lt;img src="http://www.javascript-examples.com/images/download.png" /&gt;&lt;/a&gt;&lt;/span&gt; &lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8707790305856929068-1581146740240495430?l=javascriptfactory.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javascriptfactory.blogspot.com/feeds/1581146740240495430/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://javascriptfactory.blogspot.com/2009/09/improving-html-forms-with-javascript.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8707790305856929068/posts/default/1581146740240495430'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8707790305856929068/posts/default/1581146740240495430'/><link rel='alternate' type='text/html' href='http://javascriptfactory.blogspot.com/2009/09/improving-html-forms-with-javascript.html' title='Improving HTML forms with Javascript'/><author><name>Vipin C</name><uri>http://www.blogger.com/profile/01967245433419006643</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8707790305856929068.post-8716612187904512932</id><published>2009-09-16T07:14:00.001-07:00</published><updated>2009-09-16T07:14:50.683-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Threading'/><category scheme='http://www.blogger.com/atom/ns#' term='Examples'/><title type='text'>Multi-threaded execution of code. Javascript threads.</title><content type='html'>&lt;span style="font-size: small;"&gt;&lt;/span&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&lt;span class="day style6"&gt;&lt;/span&gt;&lt;/span&gt;   &lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt; &lt;span style="font-size: small;"&gt;&lt;b&gt;Narrative JavaScript&lt;/b&gt;&lt;br /&gt;Narrative JavaScript is a small extension to the JavaScript language that enables blocking capabilities for asynchronous event callbacks. This makes asynchronous code refreshingly readable and comprehensible.&lt;br /&gt;&lt;/span&gt; &lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;  &lt;span style="font-size: small;"&gt;&lt;a href="http://neilmix.com/narrativejs/doc/index.html" target="_blank"&gt;&lt;img src="http://www.javascript-examples.com/images/homepage.png" /&gt;&lt;/a&gt;   &lt;a href="http://neilmix.com/narrativejs/doc/example.html" target="_blank"&gt;&lt;img src="http://www.javascript-examples.com/images/view_demo.png" /&gt;&lt;/a&gt;  &lt;a href="http://www.neilmix.com/narrativejs/narrativejs-beta1.zip"&gt;&lt;img src="http://www.javascript-examples.com/images/download.png" /&gt;&lt;/a&gt;&lt;/span&gt;  &lt;/div&gt;&lt;div class="post" style="font-family: Arial,Helvetica,sans-serif;"&gt; &lt;div class="date"&gt;   &lt;span style="font-size: small;"&gt;&lt;span class="month"&gt;&lt;/span&gt;&lt;span class="day style6"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;    &lt;/div&gt;&lt;span style="font-size: small;"&gt;&lt;b&gt;Javascript With Advanced Continuation Support&lt;/b&gt;&lt;br /&gt;Asynchronous operations written in a synchronous style: Traditional Ajax applications require the programmer to either write a maze of event handlers, or to provide only extremely simple and idempotent operations. Jwacs provides library functions that make asynchronous operations such as an XMLHttpRequest appear synchronous.&lt;br /&gt;&lt;/span&gt; &lt;br /&gt;&lt;span style="font-size: small;"&gt;&lt;a href="http://chumsley.org/jwacs/" target="_blank"&gt;&lt;img src="http://www.javascript-examples.com/images/homepage.png" /&gt;&lt;/a&gt;   &lt;a href="http://chumsley.org/jwacs/demos.html" target="_blank"&gt;&lt;img src="http://www.javascript-examples.com/images/view_demo.png" /&gt;&lt;/a&gt;  &lt;a href="http://chumsley.org/jwacs/downloads/"&gt;&lt;img src="http://www.javascript-examples.com/images/download.png" /&gt;&lt;/a&gt;&lt;/span&gt;  &lt;br /&gt;&lt;/div&gt;&lt;div class="post" style="font-family: Arial,Helvetica,sans-serif;"&gt; &lt;div class="date"&gt;   &lt;span style="font-size: small;"&gt;&lt;span class="month"&gt;&lt;/span&gt;&lt;span class="day style6"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;    &lt;/div&gt;&lt;span style="font-size: small;"&gt;&lt;b&gt;JsLINB - Javascript framework of LINB&lt;/b&gt;&lt;br /&gt;LINB(Lazy Internet and Browser) is designed to allow developers coding in a more targetable, clearly, and efficiently way, which is platform-independent, language-independent, and C/S, B/S, RIA compatible.&lt;br /&gt;&lt;b&gt;Thread feature&lt;/b&gt;: javascript thread implementation that can control the sequence of asyn functions.&lt;br /&gt;&lt;/span&gt;  &lt;br /&gt;&lt;span style="font-size: small;"&gt;&lt;a href="http://www.linb.net/" target="_blank"&gt;&lt;img src="http://www.javascript-examples.com/images/homepage.png" /&gt;&lt;/a&gt;   &lt;a href="http://www.linb.net/docs/examples/linb.thread.php" target="_blank"&gt;&lt;img src="http://www.javascript-examples.com/images/view_demo.png" /&gt;&lt;/a&gt;  &lt;a href="http://www.linb.net/down/index.php"&gt;&lt;img src="http://www.javascript-examples.com/images/download.png" /&gt;&lt;/a&gt;&lt;/span&gt;  &lt;br /&gt;&lt;/div&gt;&lt;div class="post" style="font-family: Arial,Helvetica,sans-serif;"&gt; &lt;div class="date"&gt;   &lt;span style="font-size: small;"&gt;&lt;span class="month"&gt;&lt;/span&gt;&lt;span class="day style6"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;    &lt;/div&gt;&lt;span style="font-size: small;"&gt;&lt;b&gt;Concurrent XML Queries with AJAX&lt;/b&gt;&lt;br /&gt;Solution that would reduce the wait time, but second reduce the amount of data shown to the user, as it is mostly similar data consolidating and filtering the data before returning it to the user is essential. Some sort of threaded model similar to the observer/observable model, where each XML query is launched on its own 'thread'. &lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: small;"&gt;&lt;a href="http://www.hwhappy.co.uk/2006/11/07/concurrent-xml-queries-with-ajax/" target="_blank"&gt;&lt;img src="http://www.javascript-examples.com/images/homepage.png" /&gt;&lt;/a&gt;&lt;/span&gt;  &lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8707790305856929068-8716612187904512932?l=javascriptfactory.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javascriptfactory.blogspot.com/feeds/8716612187904512932/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://javascriptfactory.blogspot.com/2009/09/multi-threaded-execution-of-code.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8707790305856929068/posts/default/8716612187904512932'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8707790305856929068/posts/default/8716612187904512932'/><link rel='alternate' type='text/html' href='http://javascriptfactory.blogspot.com/2009/09/multi-threaded-execution-of-code.html' title='Multi-threaded execution of code. Javascript threads.'/><author><name>Vipin C</name><uri>http://www.blogger.com/profile/01967245433419006643</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8707790305856929068.post-8048669679468916708</id><published>2009-09-16T07:12:00.001-07:00</published><updated>2009-09-16T07:12:30.963-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Examples'/><category scheme='http://www.blogger.com/atom/ns#' term='Autosuggest and Autocomplete'/><title type='text'>Javascript Autosuggest and Autocomplete Examples</title><content type='html'>&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&lt;span class="day style6"&gt;01&lt;/span&gt;&lt;/span&gt;          &lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt; &lt;span style="font-size: small;"&gt;&lt;b&gt;AutoComplete from phpguru.org&lt;/b&gt;&lt;br /&gt;&lt;img alt="Phpguru autocomplete" height="174" src="http://www.javascript-examples.com/content/autocomplete/phpguru/phpguru.png" width="323" /&gt;&lt;br /&gt;A Javascript library which provides an autocomplete dropdown which you can attach to one or more form inputs (typically text inputs, or textareas). It functions the same as the Internet Explorer autocomplete dropdown, and works on MSIE, and Firefox (tested on IE6, 5.5 &amp;amp; 5 and Firefox 1.0.1).&lt;br /&gt;&lt;/span&gt;  &lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt; &lt;span style="font-size: small;"&gt;&lt;a href="http://www.phpguru.org/static/AutoComplete.html" target="_blank"&gt;&lt;img src="http://www.javascript-examples.com/images/homepage.png" /&gt;&lt;/a&gt; &lt;a href="http://www.phpguru.org/downloads/AutoComplete/AutoComplete.html" target="_blank"&gt;&lt;img src="http://www.javascript-examples.com/images/view_demo.png" /&gt;&lt;/a&gt; &lt;a href="http://www.javascript-examples.com/content/autocomplete/phpguru/phpguru-autocomplete.zip"&gt;&lt;img src="http://www.javascript-examples.com/images/download.png" /&gt;&lt;/a&gt;&lt;/span&gt; &lt;/div&gt;&lt;div class="post" style="font-family: Arial,Helvetica,sans-serif;"&gt; &lt;div class="date"&gt;   &lt;span style="font-size: small;"&gt;&lt;span class="month"&gt;&lt;/span&gt;&lt;span class="day style6"&gt;02&lt;/span&gt;&lt;/span&gt;           &lt;/div&gt;&lt;span style="font-size: small;"&gt;&lt;b&gt;WICK AutoComplete&lt;/b&gt;&lt;br /&gt;&lt;img alt="WICK AutoComplete demo" height="110" src="http://www.javascript-examples.com/content/autocomplete/wick/wick.gif" width="320" /&gt;&lt;br /&gt;&lt;br /&gt;This is WICK, the Web Input Completion Kit, an evolving framework that leverages web standards such as JavaScript, DOM and CSS to facilitate textual input in form UI elements assisted by local and remote data sources. This framework strives to remain unobtrusive and preserve a form's semantics and accessibility. &lt;/span&gt; &lt;br /&gt;&lt;span style="font-size: small;"&gt;&lt;a href="http://wick.sourceforge.net/" target="_blank"&gt;&lt;img src="http://www.javascript-examples.com/images/homepage.png" /&gt;&lt;/a&gt; &lt;a href="http://wick.sourceforge.net/wick_sample/" target="_blank"&gt;&lt;img src="http://www.javascript-examples.com/images/view_demo.png" /&gt;&lt;/a&gt; &lt;a href="http://www.javascript-examples.com/content/autocomplete/wick/wick_0.1.tar.gz"&gt;&lt;img src="http://www.javascript-examples.com/images/download.png" /&gt;&lt;/a&gt;&lt;/span&gt; &lt;br /&gt;&lt;/div&gt;&lt;div class="post" style="font-family: Arial,Helvetica,sans-serif;"&gt; &lt;div class="date"&gt;   &lt;span style="font-size: small;"&gt;&lt;span class="month"&gt;&lt;/span&gt;&lt;span class="day style6"&gt;03&lt;/span&gt;&lt;/span&gt;           &lt;/div&gt;&lt;span style="font-size: small;"&gt;&lt;b&gt;Script.aculo.us Autocompleter&lt;/b&gt;&lt;br /&gt;&lt;img alt="Script.aculo.us demo version" height="143" src="http://www.javascript-examples.com/content/autocomplete/scriptaculous/autocompletion.gif" width="323" /&gt;&lt;br /&gt;&lt;br /&gt;Easy-to-use, cross-browser user interface JavaScript libraries to make your web sites and web applications fly. It's an add-on to the Prototype framework. Autocompleting text fields with this library is very easy. &lt;/span&gt; &lt;br /&gt;&lt;span style="font-size: small;"&gt;&lt;a href="http://demo.script.aculo.us/" target="_blank"&gt;&lt;img src="http://www.javascript-examples.com/images/homepage.png" /&gt;&lt;/a&gt; &lt;a href="http://demo.script.aculo.us/ajax/autocompleter" target="_blank"&gt;&lt;img src="http://www.javascript-examples.com/images/view_demo.png" /&gt;&lt;/a&gt;&lt;/span&gt;  &lt;br /&gt;&lt;/div&gt;&lt;div class="post" style="font-family: Arial,Helvetica,sans-serif;"&gt; &lt;div class="date"&gt;   &lt;span style="font-size: small;"&gt;&lt;span class="month"&gt;&lt;/span&gt;&lt;span class="day style6"&gt;04&lt;/span&gt;&lt;/span&gt;           &lt;/div&gt;&lt;span style="font-size: small;"&gt;&lt;b&gt;BComplete Autosuggest Script&lt;/b&gt;&lt;br /&gt;&lt;img alt="Bcomplete java script solution" height="126" src="http://www.javascript-examples.com/content/autocomplete/bcomplete/bcomplete.gif" width="225" /&gt;&lt;br /&gt;BComplete is an autocomplete (or auto-suggest, perhaps) script for web applications, similar to what Google and Yahoo employ in some of their online programs. &lt;/span&gt; &lt;br /&gt;&lt;span style="font-size: small;"&gt;&lt;a href="http://www.moderatedesign.org/projects/bcomplete/" target="_blank"&gt;&lt;img src="http://www.javascript-examples.com/images/homepage.png" /&gt;&lt;/a&gt; &lt;a href="http://www.moderatedesign.org/projects/bcomplete/files/bcomplete-1.2.zip" target="_blank"&gt;&lt;img src="http://www.javascript-examples.com/images/download.png" /&gt;&lt;/a&gt;&lt;/span&gt;  &lt;br /&gt;&lt;/div&gt;&lt;div class="post" style="font-family: Arial,Helvetica,sans-serif;"&gt; &lt;div class="date"&gt;   &lt;span style="font-size: small;"&gt;&lt;span class="month"&gt;&lt;/span&gt;&lt;span class="day style6"&gt;05&lt;/span&gt;&lt;/span&gt;           &lt;/div&gt;&lt;span style="font-size: small;"&gt;&lt;b&gt;Autocompletition by Wiseguysonly&lt;/b&gt;&lt;br /&gt;&lt;img alt="Autocompletion with AJAX" height="111" src="http://www.javascript-examples.com/content/autocomplete/wiseguysonly/wiseguys.gif" width="245" /&gt;&lt;br /&gt;Ajax autocompletion for the impatient. Making input fields that attempt to second guess what your user is typing based on live data. This is the PHP mix, but it is presented out-of-depth enough to make it easily extensible into the language of your choice (e.g. ASP, ColdFusion, Perl, Ruby etc). &lt;/span&gt; &lt;br /&gt;&lt;span style="font-size: small;"&gt;&lt;a href="http://wiseguysonly.com/2006/04/14/ajax-autocompletion-for-the-impatient/" target="_blank"&gt;&lt;img src="http://www.javascript-examples.com/images/homepage.png" /&gt;&lt;/a&gt; &lt;a href="http://wiseguysonly.com/demos/ajax-autocompletion/autocomplete.php" target="_blank"&gt;&lt;img src="http://www.javascript-examples.com/images/view_demo.png" /&gt;&lt;/a&gt; &lt;a href="http://wiseguysonly.com/downloads/ajax-autocompletion.zip" target="_blank"&gt;&lt;img src="http://www.javascript-examples.com/images/download.png" /&gt;&lt;/a&gt;&lt;/span&gt; &lt;br /&gt;&lt;/div&gt;&lt;div class="post" style="font-family: Arial,Helvetica,sans-serif;"&gt; &lt;div class="date"&gt;   &lt;span style="font-size: small;"&gt;&lt;span class="month"&gt;&lt;/span&gt;&lt;span class="day style6"&gt;06&lt;/span&gt;&lt;/span&gt;           &lt;/div&gt;&lt;span style="font-size: small;"&gt;&lt;b&gt;Autocomplete control from Momche&lt;/b&gt;&lt;br /&gt;&lt;img alt="Autocomplete control with dropdown" height="31" src="http://www.javascript-examples.com/content/autocomplete/momche/momche.gif" width="218" /&gt;&lt;br /&gt;To use this script the INPUT field's tag, which will be autocompleted should have an attribute autocomplete. Tested with: IE 5+, Mozilla (NS 6,7) &lt;/span&gt; &lt;br /&gt;&lt;span style="font-size: small;"&gt;&lt;a href="http://momche.net/" target="_blank"&gt;&lt;img src="http://www.javascript-examples.com/images/homepage.png" /&gt;&lt;/a&gt; &lt;a href="http://momche.net/res/autocomplete/" target="_blank"&gt;&lt;img src="http://www.javascript-examples.com/images/view_demo.png" /&gt;&lt;/a&gt; &lt;a href="http://www.momche.net/publish/downloads/moacdropdown.zip" target="_blank"&gt;&lt;img src="http://www.javascript-examples.com/images/download.png" /&gt;&lt;/a&gt;&lt;/span&gt; &lt;br /&gt;&lt;/div&gt;&lt;div class="post" style="font-family: Arial,Helvetica,sans-serif;"&gt; &lt;div class="date"&gt;   &lt;span style="font-size: small;"&gt;&lt;span class="month"&gt;&lt;/span&gt;&lt;span class="day style6"&gt;07&lt;/span&gt;&lt;/span&gt;           &lt;/div&gt;&lt;span style="font-size: small;"&gt;&lt;b&gt;AutoSuggest: An AJAX auto-complete text field&lt;/b&gt;&lt;br /&gt;&lt;img alt="AutoSuggest text field" height="88" src="http://www.javascript-examples.com/content/autocomplete/ajax_autosuggest/ajax_autosuggest.gif" width="273" /&gt;&lt;br /&gt;The AutoSuggest class adds a popdown menu of suggested values to a text field. The user can either click directly on a suggestion to enter it into the field, or navigate the list using the up and down arrow keys, selecting a value using the tab key. The values for the suggestion list are to provided as XML (by a PHP script, or similar). &lt;/span&gt; &lt;br /&gt;&lt;span style="font-size: small;"&gt;&lt;a href="http://www.brandspankingnew.net/archive/2006/08/ajax_auto-suggest_auto-complete.html" target="_blank"&gt;&lt;img src="http://www.javascript-examples.com/images/homepage.png" /&gt;&lt;/a&gt; &lt;a href="http://www.brandspankingnew.net/specials/ajax_autosuggest/jamietest.html" target="_blank"&gt;&lt;img src="http://www.javascript-examples.com/images/view_demo.png" /&gt;&lt;/a&gt; &lt;a href="http://brandspankingnew.net/download.php?file=autosuggest_v1.1.zip" target="_blank"&gt;&lt;img src="http://www.javascript-examples.com/images/download.png" /&gt;&lt;/a&gt;&lt;/span&gt; &lt;br /&gt;&lt;/div&gt;&lt;div class="post" style="font-family: Arial,Helvetica,sans-serif;"&gt; &lt;div class="date"&gt;   &lt;span style="font-size: small;"&gt;&lt;span class="month"&gt;&lt;/span&gt;&lt;span class="day style6"&gt;08&lt;/span&gt;&lt;/span&gt;   &lt;/div&gt;&lt;span style="font-size: small;"&gt;&lt;b&gt;Ajax dynamic list&lt;/b&gt;&lt;br /&gt;&lt;img alt="Ajax dynamic list script" height="149" src="http://www.javascript-examples.com/content/autocomplete/ajax-dynamic-list/dyn-list.gif" width="277" /&gt;&lt;br /&gt;This script shows you a list of options based on what you type into a text input. Example: Type in "A" and Ajax will get you a list of all contries starting with "A". &lt;/span&gt; &lt;br /&gt;&lt;span style="font-size: small;"&gt;&lt;a href="http://www.dhtmlgoodies.com/index.html?whichScript=ajax-dynamic-list" target="_blank"&gt;&lt;img src="http://www.javascript-examples.com/images/homepage.png" /&gt;&lt;/a&gt; &lt;a href="http://www.dhtmlgoodies.com/scripts/ajax-dynamic-list/ajax-dynamic-list.html" target="_blank"&gt;&lt;img src="http://www.javascript-examples.com/images/view_demo.png" /&gt;&lt;/a&gt; &lt;a href="http://www.dhtmlgoodies.com/scripts/ajax-dynamic-list/ajax-dynamic-list.zip" target="_blank"&gt;&lt;img src="http://www.javascript-examples.com/images/download.png" /&gt;&lt;/a&gt;&lt;/span&gt; &lt;br /&gt;&lt;/div&gt;&lt;div class="post" style="font-family: Arial,Helvetica,sans-serif;"&gt; &lt;div class="date"&gt;   &lt;span style="font-size: small;"&gt;&lt;span class="month"&gt;&lt;/span&gt;&lt;span class="day style6"&gt;09&lt;/span&gt;&lt;/span&gt;    &lt;/div&gt;&lt;span style="font-size: small;"&gt;&lt;b&gt;AutoSuggest&lt;/b&gt;&lt;br /&gt;&lt;img alt="AutoSuggest" height="82" src="http://www.javascript-examples.com/content/autocomplete/autosuggest/autosuggest.gif" width="284" /&gt;&lt;br /&gt;An attempt at a simple method for javascript-based suggestion dropdowns for autocompletion. Text input fields with customized automatic completion have lots of great uses. This script is an attempt at providing a solution to the problem that is clear and modular enough to be easily hacked up and modified for other uses. &lt;/span&gt; &lt;br /&gt;&lt;span style="font-size: small;"&gt;&lt;a href="http://www.gadgetopia.com/post/3773" target="_blank"&gt;&lt;img src="http://www.javascript-examples.com/images/homepage.png" /&gt;&lt;/a&gt; &lt;a href="http://gadgetopia.com/autosuggest/index.html" target="_blank"&gt;&lt;img src="http://www.javascript-examples.com/images/view_demo.png" /&gt;&lt;/a&gt;&lt;/span&gt; &lt;br /&gt;&lt;/div&gt;&lt;div class="post" style="font-family: Arial,Helvetica,sans-serif;"&gt; &lt;div class="date"&gt;   &lt;span style="font-size: small;"&gt;&lt;span class="month"&gt;&lt;/span&gt;&lt;span class="day style6"&gt;10&lt;/span&gt;&lt;/span&gt;    &lt;/div&gt;&lt;span style="font-size: small;"&gt;&lt;b&gt;XMLHttpRequest Autocomplete&lt;/b&gt;&lt;br /&gt;Type the first few letters of an english word in the text field and pause for a second. You can use the arrow keys and mouse to navigate the list of suggestions. Tab, enter, or clicking will replace the contents of the text field with the selected entry from the list. &lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: small;"&gt;&lt;a href="http://www.papermountain.org/demos/live/" target="_blank"&gt;&lt;img src="http://www.javascript-examples.com/images/homepage.png" /&gt;&lt;/a&gt;&lt;/span&gt; &lt;br /&gt;&lt;/div&gt;&lt;div class="post" style="font-family: Arial,Helvetica,sans-serif;"&gt; &lt;div class="date"&gt;   &lt;span style="font-size: small;"&gt;&lt;span class="month"&gt;&lt;/span&gt;&lt;span class="day style6"&gt;11&lt;/span&gt;&lt;/span&gt;    &lt;/div&gt;&lt;span style="font-size: small;"&gt;&lt;b&gt;GMail-style text completion for text input elements&lt;/b&gt;&lt;br /&gt;This implementation works for recent versions of Mozilla, Firefox and Internet Explorer. Simply type a character or two. After a (customisable) delay, a remote database will be queried for suitable completions, these completions will be presented to you in a drop-down style box. Make your selection with the Up/Down keys followed by Enter. &lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: small;"&gt;&lt;a href="http://www.dcs.lancs.ac.uk/%7Egrill/mgbox/" target="_blank"&gt;&lt;img src="http://www.javascript-examples.com/images/homepage.png" /&gt;&lt;/a&gt;&lt;/span&gt; &lt;br /&gt;&lt;/div&gt;&lt;div class="post" style="font-family: Arial,Helvetica,sans-serif;"&gt; &lt;div class="date"&gt;   &lt;span style="font-size: small;"&gt;&lt;span class="month"&gt;&lt;/span&gt;&lt;span class="day style6"&gt;12&lt;/span&gt;&lt;/span&gt;    &lt;/div&gt;&lt;span style="font-size: small;"&gt;&lt;b&gt;Nitobi AJAX components demo&lt;/b&gt;&lt;br /&gt;The Ultimate Ajax-powered Autocomplete Solution. Featuring six unique search modes with support for multiple platforms and browsers. Perform paging, suggestive searching, and fuzzy-searching in an easy-to-implement interface. &lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: small;"&gt;&lt;a href="http://www.nitobi.com/products/combobox/" target="_blank"&gt;&lt;img src="http://www.javascript-examples.com/images/homepage.png" /&gt;&lt;/a&gt; &lt;a href="http://www.nitobi.com/products/combobox/demos/Basic/Filter/index.html" target="_blank"&gt;&lt;img src="http://www.javascript-examples.com/images/view_demo.png" /&gt;&lt;/a&gt;&lt;/span&gt; &lt;br /&gt;&lt;/div&gt;&lt;div class="post" style="font-family: Arial,Helvetica,sans-serif;"&gt; &lt;div class="date"&gt;   &lt;span style="font-size: small;"&gt;&lt;span class="month"&gt;&lt;/span&gt;&lt;span class="day style6"&gt;13&lt;/span&gt;&lt;/span&gt;    &lt;/div&gt;&lt;span style="font-size: small;"&gt;&lt;b&gt;Capxous framework&lt;/b&gt;&lt;br /&gt;&lt;img alt="Capxous javascript framework" height="137" src="http://www.javascript-examples.com/content/autocomplete/capxous/capxous.gif" width="178" /&gt;&lt;br /&gt;The most elegant AJAX autocomplete component in community User types in text field. JavaScript makes the retrieval URL then sends an AJAX request. JavaScript shows suggestion list received from the server side. &lt;/span&gt; &lt;br /&gt;&lt;span style="font-size: small;"&gt;&lt;a href="http://capxous.com/" target="_blank"&gt;&lt;img src="http://www.javascript-examples.com/images/homepage.png" /&gt;&lt;/a&gt; &lt;a href="http://capxous.com/autocomplete.zip" target="_blank"&gt;&lt;img src="http://www.javascript-examples.com/images/download.png" /&gt;&lt;/a&gt;&lt;/span&gt; &lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8707790305856929068-8048669679468916708?l=javascriptfactory.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javascriptfactory.blogspot.com/feeds/8048669679468916708/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://javascriptfactory.blogspot.com/2009/09/javascript-autosuggest-and-autocomplete.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8707790305856929068/posts/default/8048669679468916708'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8707790305856929068/posts/default/8048669679468916708'/><link rel='alternate' type='text/html' href='http://javascriptfactory.blogspot.com/2009/09/javascript-autosuggest-and-autocomplete.html' title='Javascript Autosuggest and Autocomplete Examples'/><author><name>Vipin C</name><uri>http://www.blogger.com/profile/01967245433419006643</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8707790305856929068.post-8667767525714356587</id><published>2009-09-16T07:09:00.000-07:00</published><updated>2009-09-16T07:09:20.682-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Examples'/><category scheme='http://www.blogger.com/atom/ns#' term='Calendars'/><title type='text'>Javascript Calendars</title><content type='html'>&lt;span style="font-size: small;"&gt;&lt;/span&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&lt;span class="day style6"&gt;01&lt;/span&gt;&lt;/span&gt;  &lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt; &lt;span style="font-size: small;"&gt;&lt;b&gt;JS Calendar from Dynarch&lt;/b&gt;&lt;br /&gt;&lt;img alt="" height="206" src="http://www.javascript-examples.com/images/javascript-calendars/js-calendar-dynarch.jpg" width="228" /&gt;&lt;br /&gt;Open-source javaScript calendar. Look is customizable through external CSS; translated into many languages; allows multiple days selection. Fast and very easy to setup. &lt;br /&gt;&lt;/span&gt;  &lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt; &lt;span style="font-size: small;"&gt;&lt;a href="http://www.dynarch.com/projects/calendar/" target="_blank"&gt;&lt;img src="http://www.javascript-examples.com/images/homepage.png" /&gt;&lt;/a&gt;  &lt;a href="http://www.dynarch.com/demos/jscalendar/" target="_blank"&gt;&lt;img src="http://www.javascript-examples.com/images/view_demo.png" /&gt;&lt;/a&gt; &lt;a href="http://prdownloads.sourceforge.net/jscalendar/jscalendar-1.0.zip?download" target="_blank"&gt;&lt;img src="http://www.javascript-examples.com/images/download.png" /&gt;&lt;/a&gt;&lt;/span&gt; &lt;/div&gt;&lt;div class="post" style="font-family: Arial,Helvetica,sans-serif;"&gt; &lt;div class="date"&gt;&lt;span style="font-size: small;"&gt;&lt;span class="month"&gt;&lt;/span&gt;&lt;span class="day style6"&gt;02&lt;/span&gt;&lt;/span&gt;   &lt;/div&gt;&lt;span style="font-size: small;"&gt;&lt;b&gt;jCalendar by Ted Serbinsky&lt;/b&gt;&lt;br /&gt;&lt;img alt="" height="171" src="http://www.javascript-examples.com/images/javascript-calendars/jcalendar-ted-serbinsky.jpg" width="198" /&gt;&lt;br /&gt;Inline dynamic calendar built with jQuery. It originally started off based on the great jQuery date picker by Kelvin Luck but has quickly morphed into its own code base. jCalendar v0.5 can be used with 3 form selects (one for day, month, and year) to visually select a specific date for input. &lt;br /&gt;&lt;/span&gt;  &lt;br /&gt;&lt;span style="font-size: small;"&gt;&lt;a href="http://tedserbinski.com/jcalendar/index.html" target="_blank"&gt;&lt;img src="http://www.javascript-examples.com/images/homepage.png" /&gt;&lt;/a&gt;  &lt;a href="http://tedserbinski.com/jcalendar/index.html#demo" target="_blank"&gt;&lt;img src="http://www.javascript-examples.com/images/view_demo.png" /&gt;&lt;/a&gt; &lt;a href="http://tedserbinski.com/jcalendar/index.html#use" target="_blank"&gt;&lt;img src="http://www.javascript-examples.com/images/download.png" /&gt;&lt;/a&gt;&lt;/span&gt; &lt;br /&gt;&lt;/div&gt;&lt;div class="post" style="font-family: Arial,Helvetica,sans-serif;"&gt; &lt;div class="date"&gt;&lt;span style="font-size: small;"&gt;&lt;span class="month"&gt;&lt;/span&gt;&lt;span class="day style6"&gt;03&lt;/span&gt;&lt;/span&gt;   &lt;/div&gt;&lt;span style="font-size: small;"&gt;&lt;b&gt;jQuery UI Datepicker&lt;/b&gt;&lt;br /&gt;&lt;img alt="" height="160" src="http://www.javascript-examples.com/images/javascript-calendars/jquery-ui-datepicker.jpg" width="208" /&gt;&lt;br /&gt;Project gained traction in late 2006, when it was first released. Now the project has well over 35 customization options and counting. The datepicker is also in around 30 languages, showing its adoption worldwide. &lt;br /&gt;&lt;/span&gt;  &lt;br /&gt;&lt;span style="font-size: small;"&gt;&lt;a href="http://marcgrabanski.com/pages/code/jquery-ui-datepicker" target="_blank"&gt;&lt;img src="http://www.javascript-examples.com/images/homepage.png" /&gt;&lt;/a&gt;  &lt;a href="http://ui.jquery.com/repository/latest/demos/functional/#ui.datepicker" target="_blank"&gt;&lt;img src="http://www.javascript-examples.com/images/view_demo.png" /&gt;&lt;/a&gt;&lt;/span&gt; &lt;br /&gt;&lt;/div&gt;&lt;div class="post" style="font-family: Arial,Helvetica,sans-serif;"&gt; &lt;div class="date"&gt;&lt;span style="font-size: small;"&gt;&lt;span class="month"&gt;&lt;/span&gt;&lt;span class="day style6"&gt;04&lt;/span&gt;&lt;/span&gt;   &lt;/div&gt;&lt;span style="font-size: small;"&gt;&lt;b&gt;jQuery date picker plug-in&lt;/b&gt;&lt;br /&gt;&lt;img alt="" height="148" src="http://www.javascript-examples.com/images/javascript-calendars/jquery-date-picker-plug-in.jpg" width="175" /&gt;&lt;br /&gt;A flexible unobtrusive calendar component for jQuery. Change the date format and first day of the week displayed for the date picker, select multiply dates, control the look and behaviour of the rendered calendar. You can also use this script as two date pickers together so that the date selected in one influences the dates that can be selected in the other. More than 10 demos available for this script. &lt;br /&gt;&lt;/span&gt;  &lt;br /&gt;&lt;span style="font-size: small;"&gt;&lt;a href="http://www.kelvinluck.com/assets/jquery/datePicker/v2/demo/" target="_blank"&gt;&lt;img src="http://www.javascript-examples.com/images/homepage.png" /&gt;&lt;/a&gt;  &lt;a href="http://www.kelvinluck.com/assets/jquery/datePicker/v2/demo/datePickerDefaultToday.html" target="_blank"&gt;&lt;img src="http://www.javascript-examples.com/images/view_demo.png" /&gt;&lt;/a&gt;&lt;/span&gt; &lt;br /&gt;&lt;/div&gt;&lt;div class="post" style="font-family: Arial,Helvetica,sans-serif;"&gt; &lt;div class="date"&gt;&lt;span style="font-size: small;"&gt;&lt;span class="month"&gt;&lt;/span&gt;&lt;span class="day style6"&gt;05&lt;/span&gt;&lt;/span&gt;   &lt;/div&gt;&lt;span style="font-size: small;"&gt;&lt;b&gt;Epoch DHTML Calendar&lt;/b&gt;&lt;br /&gt;&lt;img alt="" height="207" src="http://www.javascript-examples.com/images/javascript-calendars/epoch-dhtml-calendar.jpg" width="202" /&gt;&lt;br /&gt;Change the date format and first day of the week displayed for the date picker, select multiply dates, control the look and behaviour of the rendered calendar. You can also use this script as two date pickers together so that the date selected in one influences the dates that can be selected in the other. &lt;br /&gt;&lt;/span&gt;  &lt;br /&gt;&lt;span style="font-size: small;"&gt;&lt;a href="http://www.javascriptkit.com/script/script2/epoch/index.shtml" target="_blank"&gt;&lt;img src="http://www.javascript-examples.com/images/homepage.png" /&gt;&lt;/a&gt;  &lt;a href="http://www.meanfreepath.com/javascript_calendar/livedemo.html" target="_blank"&gt;&lt;img src="http://www.javascript-examples.com/images/view_demo.png" /&gt;&lt;/a&gt; &lt;a href="http://www.javascriptkit.com/script/script2/epoch/epoch_v106_en.zip" target="_blank"&gt;&lt;img src="http://www.javascript-examples.com/images/download.png" /&gt;&lt;/a&gt;&lt;/span&gt; &lt;br /&gt;&lt;/div&gt;&lt;div class="post" style="font-family: Arial,Helvetica,sans-serif;"&gt; &lt;div class="date"&gt;&lt;span style="font-size: small;"&gt;&lt;span class="month"&gt;&lt;/span&gt;&lt;span class="day style6"&gt;06&lt;/span&gt;&lt;/span&gt;   &lt;/div&gt;&lt;span style="font-size: small;"&gt;&lt;b&gt;Dynamic Date Selector&lt;/b&gt;&lt;br /&gt;&lt;img alt="" height="206" src="http://www.javascript-examples.com/images/javascript-calendars/dynamic-date-selector.jpg" width="276" /&gt;&lt;br /&gt;A visually attractive dynamic date selector for form input fields. When the user clicks on a input field, the calendar will pop to let the user easily select a date value to enter. Script tested and works on Firefox, Internet Explorer, Netscape, Opera. &lt;br /&gt;&lt;/span&gt;  &lt;br /&gt;&lt;span style="font-size: small;"&gt;&lt;a href="http://www.javascriptkit.com/script/script2/dyndateselector.shtml" target="_blank"&gt;&lt;img src="http://www.javascript-examples.com/images/homepage.png" /&gt;&lt;/a&gt;&lt;/span&gt;  &lt;br /&gt;&lt;/div&gt;&lt;div class="post" style="font-family: Arial,Helvetica,sans-serif;"&gt; &lt;div class="date"&gt;&lt;span style="font-size: small;"&gt;&lt;span class="month"&gt;&lt;/span&gt;&lt;span class="day style6"&gt;07&lt;/span&gt;&lt;/span&gt;   &lt;/div&gt;&lt;span style="font-size: small;"&gt;&lt;b&gt;Events Calendar&lt;/b&gt;&lt;br /&gt;&lt;img alt="" height="294" src="http://www.javascript-examples.com/images/javascript-calendars/events-calendar.jpg" width="312" /&gt;&lt;br /&gt;An Events Calendar script that, along with the current month calendar, displays important events for specific dates. Click on a relevant date, and a description of the event associated with it is shown. The events are stored in an external .js file. This script is compatible in both IE and Firebox. &lt;br /&gt;&lt;/span&gt;  &lt;br /&gt;&lt;span style="font-size: small;"&gt;&lt;a href="http://www.javascriptkit.com/script/script2/eventscalendar.shtml" target="_blank"&gt;&lt;img src="http://www.javascript-examples.com/images/homepage.png" /&gt;&lt;/a&gt;  &lt;a href="http://www.javascriptkit.com/script/script2/evtcal.zip" target="_blank"&gt;&lt;img src="http://www.javascript-examples.com/images/download.png" /&gt;&lt;/a&gt;&lt;/span&gt; &lt;br /&gt;&lt;/div&gt;&lt;div class="post" style="font-family: Arial,Helvetica,sans-serif;"&gt; &lt;div class="date"&gt;&lt;span style="font-size: small;"&gt;&lt;span class="month"&gt;&lt;/span&gt;&lt;span class="day style6"&gt;08&lt;/span&gt;&lt;/span&gt;   &lt;/div&gt;&lt;span style="font-size: small;"&gt;&lt;b&gt;Popup date picker&lt;/b&gt;&lt;br /&gt;&lt;img alt="" height="222" src="http://www.javascript-examples.com/images/javascript-calendars/popup-date-picker.jpg" width="205" /&gt;&lt;br /&gt;Make it easy for your visitors to fill out the date/time field(s) of your form, by selecting this info from a popup calendar. &lt;br /&gt;&lt;/span&gt;  &lt;br /&gt;&lt;span style="font-size: small;"&gt;&lt;a href="http://www.javascriptkit.com/script/script2/timestamp.shtml" target="_blank"&gt;&lt;img src="http://www.javascript-examples.com/images/homepage.png" /&gt;&lt;/a&gt;  &lt;a href="http://www.javascriptkit.com/script/script2/datepick.zip" target="_blank"&gt;&lt;img src="http://www.javascript-examples.com/images/download.png" /&gt;&lt;/a&gt;&lt;/span&gt; &lt;br /&gt;&lt;/div&gt;&lt;div class="post" style="font-family: Arial,Helvetica,sans-serif;"&gt; &lt;div class="date"&gt;&lt;span style="font-size: small;"&gt;&lt;span class="month"&gt;&lt;/span&gt;&lt;span class="day style6"&gt;09&lt;/span&gt;&lt;/span&gt;   &lt;/div&gt;&lt;span style="font-size: small;"&gt;&lt;b&gt;Form button calendar&lt;/b&gt;&lt;br /&gt;&lt;img alt="" height="275" src="http://www.javascript-examples.com/images/javascript-calendars/form-button-calendar.jpg" width="279" /&gt;&lt;br /&gt;This is an elaborate calendar script that uses form buttons to constuct each date entry. Works in all browsers, even NS6. &lt;br /&gt;&lt;/span&gt;  &lt;br /&gt;&lt;span style="font-size: small;"&gt;&lt;a href="http://www.javascriptkit.com/script/script2/buttoncalendar.shtml" target="_blank"&gt;&lt;img src="http://www.javascript-examples.com/images/homepage.png" /&gt;&lt;/a&gt;&lt;/span&gt;  &lt;br /&gt;&lt;/div&gt;&lt;div class="post" style="font-family: Arial,Helvetica,sans-serif;"&gt; &lt;div class="date"&gt;&lt;span style="font-size: small;"&gt;&lt;span class="month"&gt;&lt;/span&gt;&lt;span class="day style6"&gt;10&lt;/span&gt;&lt;/span&gt;   &lt;/div&gt;&lt;span style="font-size: small;"&gt;&lt;b&gt;Calender script with today time&lt;/b&gt;&lt;br /&gt;&lt;img alt="" height="339" src="http://www.javascript-examples.com/images/javascript-calendars/calender-script-with-today-time.jpg" width="483" /&gt;&lt;br /&gt;The below script will display a calender showing the date and time of today. Simple cut&amp;amp;paste install with one portion of code. &lt;br /&gt;&lt;/span&gt;  &lt;br /&gt;&lt;span style="font-size: small;"&gt;&lt;a href="http://www.javascriptkit.com/script/cut20.shtml" target="_blank"&gt;&lt;img src="http://www.javascript-examples.com/images/homepage.png" /&gt;&lt;/a&gt;&lt;/span&gt;  &lt;br /&gt;&lt;/div&gt;&lt;div class="post" style="font-family: Arial,Helvetica,sans-serif;"&gt; &lt;div class="date"&gt;&lt;span style="font-size: small;"&gt;&lt;span class="month"&gt;&lt;/span&gt;&lt;span class="day style6"&gt;11&lt;/span&gt;&lt;/span&gt;   &lt;/div&gt;&lt;span style="font-size: small;"&gt;&lt;b&gt;CalendarXP&lt;/b&gt;&lt;br /&gt;&lt;img alt="" height="128" src="http://www.javascript-examples.com/images/javascript-calendars/calendarxp.jpg" width="132" /&gt;&lt;br /&gt;Good-looking, if not the best, javascript calendar or datepicker without the pain of javascript. Simple to start with, while powerful enough to meet any sophisticated requirement, even driven by XML. All-purpose and extremely perfect for plain HTML, ASP, ASP.Net, JSP, PHP and ColdFusion. &lt;br /&gt;&lt;/span&gt;  &lt;br /&gt;&lt;span style="font-size: small;"&gt;&lt;a href="http://www.calendarxp.net/" target="_blank"&gt;&lt;img src="http://www.javascript-examples.com/images/homepage.png" /&gt;&lt;/a&gt;  &lt;a href="http://www.calendarxp.net/tt_pop.shtml" target="_blank"&gt;&lt;img src="http://www.javascript-examples.com/images/view_demo.png" /&gt;&lt;/a&gt; &lt;a href="http://www.calendarxp.net/downloads/FlatCalXP9_Lite.zip" target="_blank"&gt;&lt;img src="http://www.javascript-examples.com/images/download.png" /&gt;&lt;/a&gt;&lt;/span&gt; &lt;br /&gt;&lt;/div&gt;&lt;div class="post" style="font-family: Arial,Helvetica,sans-serif;"&gt; &lt;div class="date"&gt;&lt;span style="font-size: small;"&gt;&lt;span class="month"&gt;&lt;/span&gt;&lt;span class="day style6"&gt;12&lt;/span&gt;&lt;/span&gt;   &lt;/div&gt;&lt;span style="font-size: small;"&gt;&lt;b&gt;Zapatec Javascript Calendar&lt;/b&gt;&lt;br /&gt;&lt;img alt="" height="169" src="http://www.javascript-examples.com/images/javascript-calendars/zapatec-javascript-calendar.jpg" width="228" /&gt;&lt;br /&gt;The Zapatec Javascript Calendar is a feature-full, cross browser compatible, calendar. Use the calendar in pop-up mode, as a date picker, or in flat mode to display different events. &lt;br /&gt;&lt;/span&gt;  &lt;br /&gt;&lt;span style="font-size: small;"&gt;&lt;a href="http://www.zapatec.com/website/main/products/prod1/" target="_blank"&gt;&lt;img src="http://www.javascript-examples.com/images/homepage.png" /&gt;&lt;/a&gt;  &lt;a href="http://www.zapatec.com/website/main/demo.jsp#example1.html" target="_blank"&gt;&lt;img src="http://www.javascript-examples.com/images/view_demo.png" /&gt;&lt;/a&gt; &lt;a href="http://www.zapatec.com/website/ajax/zpcal/zpcal.zip" target="_blank"&gt;&lt;img src="http://www.javascript-examples.com/images/download.png" /&gt;&lt;/a&gt;&lt;/span&gt; &lt;br /&gt;&lt;/div&gt;&lt;div class="post" style="font-family: Arial,Helvetica,sans-serif;"&gt; &lt;div class="date"&gt;&lt;span style="font-size: small;"&gt;&lt;span class="month"&gt;&lt;/span&gt;&lt;span class="day style6"&gt;13&lt;/span&gt;&lt;/span&gt;   &lt;/div&gt;&lt;span style="font-size: small;"&gt;&lt;b&gt;Rich Calendar&lt;/b&gt;&lt;br /&gt;&lt;img alt="" height="189" src="http://www.javascript-examples.com/images/javascript-calendars/rich-calendar.jpg" width="188" /&gt;&lt;br /&gt;Cross-browser, 100% JavaScript calendar script implementing the appropriate functionality with many advanced options widely extending fields of its applications. Rich Calendar works in IE, Mozilla-based browsers such as Firefox, Opera 9+, and Safari 3.0. Integrated with Smart Grid (Ajax-based table editing tool). &lt;br /&gt;&lt;/span&gt;  &lt;br /&gt;&lt;span style="font-size: small;"&gt;&lt;a href="http://www.richarea.com/demo/rich_calendar/" target="_blank"&gt;&lt;img src="http://www.javascript-examples.com/images/homepage.png" /&gt;&lt;/a&gt;  &lt;a href="http://www.richarea.com/page_img/rich-calendar.zip" target="_blank"&gt;&lt;img src="http://www.javascript-examples.com/images/download.png" /&gt;&lt;/a&gt;&lt;/span&gt; &lt;br /&gt;&lt;/div&gt;&lt;div class="post" style="font-family: Arial,Helvetica,sans-serif;"&gt; &lt;div class="date"&gt;&lt;span style="font-size: small;"&gt;&lt;span class="month"&gt;&lt;/span&gt;&lt;span class="day style6"&gt;14&lt;/span&gt;&lt;/span&gt;   &lt;/div&gt;&lt;span style="font-size: small;"&gt;&lt;b&gt;NoGray Calendar Component&lt;/b&gt;&lt;br /&gt;&lt;img alt="" height="225" src="http://www.javascript-examples.com/images/javascript-calendars/nogray-calendar-component.jpg" width="185" /&gt;&lt;br /&gt;There are tons of features in this calendar package, such as: create any numbers of months per calendar; set the weekend, days off, holidays (dates off), start day of the week; start and end date; multi selection with limits or without; skinnable (using CSS); can have any number of calendars in any page; optimized for best performance. &lt;br /&gt;&lt;/span&gt;  &lt;br /&gt;&lt;span style="font-size: small;"&gt;&lt;a href="http://www.nogray.com/calendar.php" target="_blank"&gt;&lt;img src="http://www.javascript-examples.com/images/homepage.png" /&gt;&lt;/a&gt;  &lt;a href="http://www.nogray.com/calendar.php#tryit" target="_blank"&gt;&lt;img src="http://www.javascript-examples.com/images/view_demo.png" /&gt;&lt;/a&gt; &lt;a href="http://www.nogray.com/download.php?file=nogray_calendar" target="_blank"&gt;&lt;img src="http://www.javascript-examples.com/images/download.png" /&gt;&lt;/a&gt;&lt;/span&gt; &lt;br /&gt;&lt;/div&gt;&lt;div class="post" style="font-family: Arial,Helvetica,sans-serif;"&gt; &lt;div class="date"&gt;&lt;span style="font-size: small;"&gt;&lt;span class="month"&gt;&lt;/span&gt;&lt;span class="day style6"&gt;15&lt;/span&gt;&lt;/span&gt;   &lt;/div&gt;&lt;span style="font-size: small;"&gt;&lt;b&gt;DatePickerControl by Hugo Ortega-Hernandez&lt;/b&gt;&lt;br /&gt;&lt;img alt="" height="165" src="http://www.javascript-examples.com/images/javascript-calendars/datepickercontrol-by-hugo-ortega-hernandez.jpg" width="250" /&gt;&lt;br /&gt;Layered calendar, without annoying pop-up windows, compatible with any server-side language. Supports mouse and keyboard navigation. LGPL License. &lt;br /&gt;&lt;/span&gt;  &lt;br /&gt;&lt;span style="font-size: small;"&gt;&lt;a href="http://dali.mty.itesm.mx/%7Ehugo/js/datepickercontrol/" target="_blank"&gt;&lt;img src="http://www.javascript-examples.com/images/homepage.png" /&gt;&lt;/a&gt;  &lt;a href="http://dali.mty.itesm.mx/%7Ehugo/js/datepickercontrol/datepickercontrol-v1_1_6.zip" target="_blank"&gt;&lt;img src="http://www.javascript-examples.com/images/download.png" /&gt;&lt;/a&gt;&lt;/span&gt; &lt;br /&gt;&lt;/div&gt;&lt;div class="post" style="font-family: Arial,Helvetica,sans-serif;"&gt; &lt;div class="date"&gt;&lt;span style="font-size: small;"&gt;&lt;span class="month"&gt;&lt;/span&gt;&lt;span class="day style6"&gt;16&lt;/span&gt;&lt;/span&gt;   &lt;/div&gt;&lt;span style="font-size: small;"&gt;&lt;b&gt;Javascript calendar widget from Codetale&lt;/b&gt;&lt;br /&gt;&lt;img alt="" height="167" src="http://www.javascript-examples.com/images/javascript-calendars/javascript-calendar-widget-from-codetale.jpg" width="243" /&gt;&lt;br /&gt;This calendar can be used as a date picker or date display. Can be used in as many instances as you want, with some handy options. In strict mode, the calendar has the date selection limited, to a certain period defined in days. In loose mode, the calendar has the date selection unlimited. You can choose the returned date format, as well as how the date should be filled back: full date in one input, or multiple inputs. &lt;br /&gt;&lt;/span&gt;  &lt;br /&gt;&lt;span style="font-size: small;"&gt;&lt;a href="http://codetale.com/2007/02/23/javascript-calendar-widget/" target="_blank"&gt;&lt;img src="http://www.javascript-examples.com/images/homepage.png" /&gt;&lt;/a&gt;  &lt;a href="http://codetale.com/cwcalendar/calendar.zip" target="_blank"&gt;&lt;img src="http://www.javascript-examples.com/images/download.png" /&gt;&lt;/a&gt;&lt;/span&gt; &lt;br /&gt;&lt;/div&gt;&lt;div class="post" style="font-family: Arial,Helvetica,sans-serif;"&gt; &lt;div class="date"&gt;&lt;span style="font-size: small;"&gt;&lt;span class="month"&gt;&lt;/span&gt;&lt;span class="day style6"&gt;17&lt;/span&gt;&lt;/span&gt;   &lt;/div&gt;&lt;span style="font-size: small;"&gt;&lt;b&gt;Javascript Datepicker control&lt;/b&gt;&lt;br /&gt;&lt;img alt="" height="180" src="http://www.javascript-examples.com/images/javascript-calendars/javascript-datepicker-control.jpg" width="155" /&gt;&lt;br /&gt;The DatePicker lets users easily select valid dates from a dropdown calendar. No need to worry about date formats, by picking dates it's always correct. Allowed input formats are: American mm/dd/yyyy (12/31/2003), European dd.mm.yyyy (31.12.2003) and ISO yyyy-mm-dd (2003-12-31). Supports skins, the style and colors can be highly customized by color names and/or css classes. &lt;br /&gt;&lt;/span&gt;  &lt;br /&gt;&lt;span style="font-size: small;"&gt;&lt;a href="http://www.blueshoes.org/en/javascript/datepicker/" target="_blank"&gt;&lt;img src="http://www.javascript-examples.com/images/homepage.png" /&gt;&lt;/a&gt;  &lt;a href="http://www.blueshoes.org/_bsJavascript/components/datepicker/examples/example2.html" target="_blank"&gt;&lt;img src="http://www.javascript-examples.com/images/view_demo.png" /&gt;&lt;/a&gt; &lt;a href="http://www.blueshoes.org/en/get/download/" target="_blank"&gt;&lt;img src="http://www.javascript-examples.com/images/download.png" /&gt;&lt;/a&gt;&lt;/span&gt; &lt;br /&gt;&lt;/div&gt;&lt;div class="post" style="font-family: Arial,Helvetica,sans-serif;"&gt; &lt;div class="date"&gt;&lt;span style="font-size: small;"&gt;&lt;span class="month"&gt;&lt;/span&gt;&lt;span class="day style6"&gt;18&lt;/span&gt;&lt;/span&gt;   &lt;/div&gt;&lt;span style="font-size: small;"&gt;&lt;b&gt;Tigra Calendar&lt;/b&gt;&lt;br /&gt;&lt;img alt="" height="154" src="http://www.javascript-examples.com/images/javascript-calendars/tigra-calendar.jpg" width="190" /&gt;&lt;br /&gt;Tigra Calendar is a free JavaScript Calendar control that makes it easy for the website users to fill out the date/time fields by selecting the date from a popup calendar. Script saves the time for those internet/intranet developers who need intuitive, easy to use cross-browser client-side date or timestamp input control. Tigra Calendar works with any browser that supports DOM (Document Object Model). The script is free for any applications. &lt;br /&gt;&lt;/span&gt;  &lt;br /&gt;&lt;span style="font-size: small;"&gt;&lt;a href="http://www.softcomplex.com/products/tigra_calendar/" target="_blank"&gt;&lt;img src="http://www.javascript-examples.com/images/homepage.png" /&gt;&lt;/a&gt;  &lt;a href="http://www.softcomplex.com/products/tigra_calendar/demo1.html" target="_blank"&gt;&lt;img src="http://www.javascript-examples.com/images/view_demo.png" /&gt;&lt;/a&gt; &lt;a href="http://www.softcomplex.com/products/tigra_calendar/download.html" target="_blank"&gt;&lt;img src="http://www.javascript-examples.com/images/download.png" /&gt;&lt;/a&gt;&lt;/span&gt; &lt;br /&gt;&lt;/div&gt;&lt;div class="post" style="font-family: Arial,Helvetica,sans-serif;"&gt; &lt;div class="date"&gt;&lt;span style="font-size: small;"&gt;&lt;span class="month"&gt;&lt;/span&gt;&lt;span class="day style6"&gt;19&lt;/span&gt;&lt;/span&gt;   &lt;/div&gt;&lt;span style="font-size: small;"&gt;&lt;b&gt;Simple Calendar Widget by Anthony Garrett&lt;/b&gt;&lt;br /&gt;&lt;img alt="" height="244" src="http://www.javascript-examples.com/images/javascript-calendars/simple-calendar-widget-by-anthony-garrett.jpg" width="199" /&gt;&lt;br /&gt;This flexible, simple pop-up calendar is written to work across browsers. It's fully commented and customisable for language, colours and date format. The pop-up displays a month at a time from a specified range of years. The optional input date determines the initial month displayed. The year can be in two or four digits while the month can be digits or a month name abbreviation that can easily be set up for any language. Any date or day of the week can be disabled (and re-enabled) using JavaScript on the calling page. This is ideal for combination with server-side technologies to produce a professional application. &lt;br /&gt;&lt;/span&gt;  &lt;br /&gt;&lt;span style="font-size: small;"&gt;&lt;a href="http://www.garrett.nildram.co.uk/calendar/scw.htm" target="_blank"&gt;&lt;img src="http://www.javascript-examples.com/images/homepage.png" /&gt;&lt;/a&gt;  &lt;a href="http://www.garrett.nildram.co.uk/calendar/scw.htm#examples-demo" target="_blank"&gt;&lt;img src="http://www.javascript-examples.com/images/view_demo.png" /&gt;&lt;/a&gt; &lt;a href="http://www.garrett.nildram.co.uk/calendar/scw.htm#available" target="_blank"&gt;&lt;img src="http://www.javascript-examples.com/images/download.png" /&gt;&lt;/a&gt;&lt;/span&gt; &lt;br /&gt;&lt;/div&gt;&lt;div class="post" style="font-family: Arial,Helvetica,sans-serif;"&gt; &lt;div class="date"&gt;&lt;span style="font-size: small;"&gt;&lt;span class="month"&gt;&lt;/span&gt;&lt;span class="day style6"&gt;20&lt;/span&gt;&lt;/span&gt;   &lt;/div&gt;&lt;span style="font-size: small;"&gt;&lt;b&gt;Javascript Event Calendar&lt;/b&gt;&lt;br /&gt;&lt;img alt="" height="136" src="http://www.javascript-examples.com/images/javascript-calendars/javascript-event-calendar.gif" width="145" /&gt;&lt;br /&gt;Javascript only, runs on any website and is cross browser compatable. Object oriented with property based design. Customizable CSS based layouts and themes, with over a dozen themes provided for you. You can quickly create recurring, holiday and special events. Supports XML data format events. Includes an event editor to assist creating events. &lt;br /&gt;&lt;/span&gt;  &lt;br /&gt;&lt;span style="font-size: small;"&gt;&lt;a href="http://www.scriptcalendar.com/scrptcal/default.aspx" target="_blank"&gt;&lt;img src="http://www.javascript-examples.com/images/homepage.png" /&gt;&lt;/a&gt;&lt;/span&gt;  &lt;br /&gt;&lt;/div&gt;&lt;div class="post" style="font-family: Arial,Helvetica,sans-serif;"&gt; &lt;div class="date"&gt;&lt;span style="font-size: small;"&gt;&lt;span class="month"&gt;&lt;/span&gt;&lt;span class="day style6"&gt;21&lt;/span&gt;&lt;/span&gt;   &lt;/div&gt;&lt;span style="font-size: small;"&gt;&lt;b&gt;CodeThatCalendar&lt;/b&gt;&lt;br /&gt;&lt;img alt="" height="116" src="http://www.javascript-examples.com/images/javascript-calendars/codethatcalendar.jpg" width="284" /&gt;&lt;br /&gt;CodeThat's Java Script date and time selectable calendar control helps making such a date or time selection the interactive process also helps making the design of the calendar to be the part of the web site appearance. You can select one of three work modes: &lt;br /&gt;1. The calendar appears in a separate window that is being shown when user clicks the button or performs another action. &lt;br /&gt;2. The calendar is displayed on the page as part of its design. &lt;br /&gt;3. iFrame calendar mode (pull down calendar). Calendar is dropped down within the frame on the window. &lt;br /&gt;&lt;/span&gt;  &lt;br /&gt;&lt;span style="font-size: small;"&gt;&lt;a href="http://www.codethat.com/javascript-calendar.html" target="_blank"&gt;&lt;img src="http://www.javascript-examples.com/images/homepage.png" /&gt;&lt;/a&gt;  &lt;a href="http://codethat.com/calendar/iframe_ex.html" target="_blank"&gt;&lt;img src="http://www.javascript-examples.com/images/view_demo.png" /&gt;&lt;/a&gt; &lt;a href="http://www.codethat.com/restricted/scripts/codethatcalendarstd.zip" target="_blank"&gt;&lt;img src="http://www.javascript-examples.com/images/download.png" /&gt;&lt;/a&gt;&lt;/span&gt; &lt;br /&gt;&lt;/div&gt;&lt;div class="post" style="font-family: Arial,Helvetica,sans-serif;"&gt; &lt;div class="date"&gt;&lt;span style="font-size: small;"&gt;&lt;span class="month"&gt;&lt;/span&gt;&lt;span class="day style6"&gt;22&lt;/span&gt;&lt;/span&gt;   &lt;/div&gt;&lt;span style="font-size: small;"&gt;&lt;b&gt;Basic Calender from Brian Gosselin&lt;/b&gt;&lt;br /&gt;&lt;img alt="" height="168" src="http://www.javascript-examples.com/images/javascript-calendars/basic-calender-from-brian-gosselin.jpg" width="285" /&gt;&lt;br /&gt;This is just a basic calender which simply sits on your page. Adjust the month and year by clicking the arrow buttons. All the settings such as colors and fonts are controlled entirely by cascading stylesheets, so you can easily adopt it to any webpage. &lt;br /&gt;&lt;/span&gt;  &lt;br /&gt;&lt;span style="font-size: small;"&gt;&lt;a href="http://scriptasylum.com/datetime/calender_b/calender_b.html" target="_blank"&gt;&lt;img src="http://www.javascript-examples.com/images/homepage.png" /&gt;&lt;/a&gt;&lt;/span&gt;  &lt;br /&gt;&lt;/div&gt;&lt;div class="post" style="font-family: Arial,Helvetica,sans-serif;"&gt; &lt;div class="date"&gt;&lt;span style="font-size: small;"&gt;&lt;span class="month"&gt;&lt;/span&gt;&lt;span class="day style6"&gt;23&lt;/span&gt;&lt;/span&gt;   &lt;/div&gt;&lt;span style="font-size: small;"&gt;&lt;b&gt;DHTML Calender from Brian Gosselin&lt;/b&gt;&lt;br /&gt;&lt;img alt="" height="192" src="http://www.javascript-examples.com/images/javascript-calendars/dhtml-calender-from-brian-gosselin.jpg" width="279" /&gt;&lt;br /&gt;Input for the calender is taken from a text box and output from the calender goes to the text box when the user clicks the desired date. If there is no text in the text box, or the text is in incorrect format, the calender will start with today's date, and will display a brief message at the bottom of the calender. &lt;br /&gt;&lt;/span&gt;  &lt;br /&gt;&lt;span style="font-size: small;"&gt;&lt;a href="http://scriptasylum.com/datetime/calender_d/calender_d.html" target="_blank"&gt;&lt;img src="http://www.javascript-examples.com/images/homepage.png" /&gt;&lt;/a&gt;&lt;/span&gt;  &lt;br /&gt;&lt;/div&gt;&lt;div class="post" style="font-family: Arial,Helvetica,sans-serif;"&gt; &lt;div class="date"&gt;&lt;span style="font-size: small;"&gt;&lt;span class="month"&gt;&lt;/span&gt;&lt;span class="day style6"&gt;24&lt;/span&gt;&lt;/span&gt;   &lt;/div&gt;&lt;span style="font-size: small;"&gt;&lt;b&gt;Perpetual Calender from Brian Gosselin&lt;/b&gt;&lt;br /&gt;&lt;img alt="" height="148" src="http://www.javascript-examples.com/images/javascript-calendars/perpetual-calender-from-brian-gosselin.jpg" width="299" /&gt;&lt;br /&gt;Just what you see. Simple calendar with navigation buttons available. &lt;br /&gt;&lt;/span&gt;  &lt;br /&gt;&lt;span style="font-size: small;"&gt;&lt;a href="http://scriptasylum.com/datetime/dhtmlcalender/dhtmlcalender.html" target="_blank"&gt;&lt;img src="http://www.javascript-examples.com/images/homepage.png" /&gt;&lt;/a&gt;&lt;/span&gt;  &lt;br /&gt;&lt;/div&gt;&lt;div class="post" style="font-family: Arial,Helvetica,sans-serif;"&gt; &lt;div class="date"&gt;&lt;span style="font-size: small;"&gt;&lt;span class="month"&gt;&lt;/span&gt;&lt;span class="day style6"&gt;25&lt;/span&gt;&lt;/span&gt;   &lt;/div&gt;&lt;span style="font-size: small;"&gt;&lt;b&gt;Dynamic Calendar from Constantin Kuznetsov Jr.&lt;/b&gt;&lt;br /&gt;&lt;img alt="" height="206" src="http://www.javascript-examples.com/images/javascript-calendars/dynamic-calendar-from-constantin-kuznetsov-jr.jpg" width="250" /&gt;&lt;br /&gt;Looks handsome, but allows you to dynamically look up the calendar for any particular month/year. Just another dhtml calendar :) &lt;br /&gt;&lt;/span&gt;  &lt;br /&gt;&lt;span style="font-size: small;"&gt;&lt;a href="http://www.dynamicdrive.com/dynamicindex6/dcalendar.htm" target="_blank"&gt;&lt;img src="http://www.javascript-examples.com/images/homepage.png" /&gt;&lt;/a&gt;&lt;/span&gt;  &lt;br /&gt;&lt;/div&gt;&lt;div class="post" style="font-family: Arial,Helvetica,sans-serif;"&gt; &lt;div class="date"&gt;&lt;span style="font-size: small;"&gt;&lt;span class="month"&gt;&lt;/span&gt;&lt;span class="day style6"&gt;26&lt;/span&gt;&lt;/span&gt;   &lt;/div&gt;&lt;span style="font-size: small;"&gt;&lt;b&gt;Dynamic Calendar from Jason Moon&lt;/b&gt;&lt;br /&gt;&lt;img alt="" height="164" src="http://www.javascript-examples.com/images/javascript-calendars/dynamic-calendar-from-jason-moon.jpg" width="236" /&gt;&lt;br /&gt;An extremely versatile DHTML calendar that's functional in IE4+ and NS6+. &lt;br /&gt;&lt;/span&gt;  &lt;br /&gt;&lt;span style="font-size: small;"&gt;&lt;a href="http://www.dynamicdrive.com/dynamicindex6/dcalendar2.htm" target="_blank"&gt;&lt;img src="http://www.javascript-examples.com/images/homepage.png" /&gt;&lt;/a&gt;&lt;/span&gt;  &lt;br /&gt;&lt;/div&gt;&lt;div class="post" style="font-family: Arial,Helvetica,sans-serif;"&gt; &lt;div class="date"&gt;&lt;span style="font-size: small;"&gt;&lt;span class="month"&gt;&lt;/span&gt;&lt;span class="day style6"&gt;27&lt;/span&gt;&lt;/span&gt;   &lt;/div&gt;&lt;span style="font-size: small;"&gt;&lt;b&gt;Popup Calendar from Sev Kotchnev&lt;/b&gt;&lt;br /&gt;&lt;img alt="" height="155" src="http://www.javascript-examples.com/images/javascript-calendars/popup-calendar-from-sev-kotchnev.jpg" width="200" /&gt;&lt;br /&gt;Visual and interactive way of selecting and inputting date, rendering the job of your visitor reaching for a physical calendar to find out the date (whether for today's or otherwise) obsolete. Very practical use of DHTML. &lt;br /&gt;&lt;/span&gt;  &lt;br /&gt;&lt;span style="font-size: small;"&gt;&lt;a href="http://www.dynamicdrive.com/dynamicindex6/popcalendar.htm" target="_blank"&gt;&lt;img src="http://www.javascript-examples.com/images/homepage.png" /&gt;&lt;/a&gt;  &lt;a href="http://www.dynamicdrive.com/dynamicindex6/popcalendar.zip" target="_blank"&gt;&lt;img src="http://www.javascript-examples.com/images/download.png" /&gt;&lt;/a&gt;&lt;/span&gt; &lt;br /&gt;&lt;/div&gt;&lt;div class="post" style="font-family: Arial,Helvetica,sans-serif;"&gt; &lt;div class="date"&gt;&lt;span style="font-size: small;"&gt;&lt;span class="month"&gt;&lt;/span&gt;&lt;span class="day style6"&gt;28&lt;/span&gt;&lt;/span&gt;   &lt;/div&gt;&lt;span style="font-size: small;"&gt;&lt;b&gt;Xin Calendar 2&lt;/b&gt;&lt;br /&gt;&lt;img alt="" height="165" src="http://www.javascript-examples.com/images/javascript-calendars/xin-calendar-2.jpg" width="193" /&gt;&lt;br /&gt;Xin Calendar 2 is a package of the In-Page and Popup-Window DHTML calendar scripts as well as some plug-in scripts for extra features. Provides plug-in features via mod scripts, including: dropdown lists to pick month and year, date ranges, open links from dates, styles for special dates, display date info, date tooltip and image tile background. &lt;br /&gt;&lt;/span&gt;  &lt;br /&gt;&lt;span style="font-size: small;"&gt;&lt;a href="http://www.yxscripts.com/xc2/index.html" target="_blank"&gt;&lt;img src="http://www.javascript-examples.com/images/homepage.png" /&gt;&lt;/a&gt;  &lt;a href="http://www.yxscripts.com/xc2/examples/static.html" target="_blank"&gt;&lt;img src="http://www.javascript-examples.com/images/view_demo.png" /&gt;&lt;/a&gt; &lt;a href="http://www.yxscripts.com/xc2/xc2.zip" target="_blank"&gt;&lt;img src="http://www.javascript-examples.com/images/download.png" /&gt;&lt;/a&gt;&lt;/span&gt; &lt;br /&gt;&lt;/div&gt;&lt;div class="post" style="font-family: Arial,Helvetica,sans-serif;"&gt; &lt;div class="date"&gt;&lt;span style="font-size: small;"&gt;&lt;span class="month"&gt;&lt;/span&gt;&lt;span class="day style6"&gt;29&lt;/span&gt;&lt;/span&gt;   &lt;/div&gt;&lt;span style="font-size: small;"&gt;&lt;b&gt;Jason's Date Input Calendar&lt;/b&gt;&lt;br /&gt;&lt;img alt="" height="114" src="http://www.javascript-examples.com/images/javascript-calendars/jasons-date-input-calendar.jpg" width="128" /&gt;&lt;br /&gt;Small and simple calendar with some customization options. &lt;br /&gt;&lt;/span&gt;  &lt;br /&gt;&lt;span style="font-size: small;"&gt;&lt;a href="http://calendar.moonscript.com/dateinput.cfm" target="_blank"&gt;&lt;img src="http://www.javascript-examples.com/images/homepage.png" /&gt;&lt;/a&gt;&lt;/span&gt;  &lt;br /&gt;&lt;/div&gt;&lt;div class="post" style="font-family: Arial,Helvetica,sans-serif;"&gt; &lt;div class="date"&gt;&lt;span style="font-size: small;"&gt;&lt;span class="month"&gt;&lt;/span&gt;&lt;span class="day style6"&gt;30&lt;/span&gt;&lt;/span&gt;   &lt;/div&gt;&lt;span style="font-size: small;"&gt;&lt;b&gt;Javascript Calendar Date Picker&lt;/b&gt;&lt;br /&gt;&lt;img alt="" height="224" src="http://www.javascript-examples.com/images/javascript-calendars/javascript-calendar-date-picker.jpg" width="163" /&gt;&lt;br /&gt;JavaScript Calendar Date Picker control makes it easy to fill out the date/time fields for the website users by selecting the date and time from a popup calendar. All you'll need is just to add the date picker into your web application and it will work. No configuration is needed. It also gives you all the ability you need for developing the most complex modules. &lt;br /&gt;&lt;/span&gt;  &lt;br /&gt;&lt;span style="font-size: small;"&gt;&lt;a href="http://calendardatepicker.com/" target="_blank"&gt;&lt;img src="http://www.javascript-examples.com/images/homepage.png" /&gt;&lt;/a&gt;  &lt;a href="http://calendardatepicker.com/samples.html" target="_blank"&gt;&lt;img src="http://www.javascript-examples.com/images/view_demo.png" /&gt;&lt;/a&gt; &lt;a href="http://deluxe-menu.com/deluxe-menu.zip" target="_blank"&gt;&lt;img src="http://www.javascript-examples.com/images/download.png" /&gt;&lt;/a&gt;&lt;/span&gt; &lt;br /&gt;&lt;/div&gt;&lt;div class="post" style="font-family: Arial,Helvetica,sans-serif;"&gt; &lt;div class="date"&gt;&lt;span style="font-size: small;"&gt;&lt;span class="month"&gt;&lt;/span&gt;&lt;span class="day style6"&gt;31&lt;/span&gt;&lt;/span&gt;   &lt;/div&gt;&lt;span style="font-size: small;"&gt;&lt;b&gt;Yahoo! UI Library: Calendar&lt;/b&gt;&lt;br /&gt;&lt;img alt="" height="210" src="http://www.javascript-examples.com/images/javascript-calendars/yahoo-ui-library-calendar.jpg" width="204" /&gt;&lt;br /&gt;The Calendar component is a UI control that enables users to choose one or more dates from a graphical calendar presented in a single month or multi month interface. Calendars are generated entirely via script and can be navigated without any page refreshes. You'll find the Calendar Control to be a useful and easy-to-implement enhancement to any date-selection interaction; you may also find that the Calendar's foundation classes are a good place to start for more complex interfaces that visually organize date-tagged information (like appointments, photos, events, etc.). &lt;br /&gt;&lt;/span&gt;  &lt;br /&gt;&lt;span style="font-size: small;"&gt;&lt;a href="http://developer.yahoo.com/yui/calendar/" target="_blank"&gt;&lt;img src="http://www.javascript-examples.com/images/homepage.png" /&gt;&lt;/a&gt;  &lt;a href="http://developer.yahoo.com/yui/examples/calendar/calnavigator.html" target="_blank"&gt;&lt;img src="http://www.javascript-examples.com/images/view_demo.png" /&gt;&lt;/a&gt; &lt;a href="http://developer.yahoo.com/yui/download/" target="_blank"&gt;&lt;img src="http://www.javascript-examples.com/images/download.png" /&gt;&lt;/a&gt;&lt;/span&gt; &lt;br /&gt;&lt;/div&gt;&lt;div class="post" style="font-family: Arial,Helvetica,sans-serif;"&gt; &lt;div class="date"&gt;&lt;span style="font-size: small;"&gt;&lt;span class="month"&gt;&lt;/span&gt;&lt;span class="day style6"&gt;32&lt;/span&gt;&lt;/span&gt;   &lt;/div&gt;&lt;span style="font-size: small;"&gt;&lt;b&gt;Date Picker Calendar from SixSide&lt;/b&gt;&lt;br /&gt;&lt;img alt="" height="214" src="http://www.javascript-examples.com/images/javascript-calendars/date-picker-calendar-from-sixside.jpg" width="287" /&gt;&lt;br /&gt;This date picker code is free to use on your own website, the only requirement is that you add a link back to SixSide.com somewhere on your website. W3C compliant XHTML and CSS, works for various countries date formats, cross browser compatible. &lt;br /&gt;&lt;/span&gt;  &lt;br /&gt;&lt;span style="font-size: small;"&gt;&lt;a href="http://www.sixside.com/asp_date_picker_calendar.asp" target="_blank"&gt;&lt;img src="http://www.javascript-examples.com/images/homepage.png" /&gt;&lt;/a&gt;  &lt;a href="http://www.sixside.com/downloads/asp_date_picker_calendar-v1.2.zip" target="_blank"&gt;&lt;img src="http://www.javascript-examples.com/images/download.png" /&gt;&lt;/a&gt;&lt;/span&gt; &lt;br /&gt;&lt;/div&gt;&lt;div class="post" style="font-family: Arial,Helvetica,sans-serif;"&gt; &lt;div class="date"&gt;&lt;span style="font-size: small;"&gt;&lt;span class="month"&gt;&lt;/span&gt;&lt;span class="day style6"&gt;33&lt;/span&gt;&lt;/span&gt;   &lt;/div&gt;&lt;span style="font-size: small;"&gt;&lt;b&gt;Calendar class for Mootools&lt;/b&gt;&lt;br /&gt;&lt;img alt="" height="280" src="http://www.javascript-examples.com/images/javascript-calendars/calendar-class-for-mootools.jpg" width="166" /&gt;&lt;br /&gt;Calendar is a Javascript class that adds accessible and unobtrusive date-pickers to your form elements. Features: style-able and semantic XHTML, future/past calendar restrictions, highly configurable use of inputs and selects, multi-calendar support, multi-lingual and fancy date formatting. &lt;br /&gt;&lt;/span&gt;  &lt;br /&gt;&lt;span style="font-size: small;"&gt;&lt;a href="http://www.electricprism.com/aeron/calendar/" target="_blank"&gt;&lt;img src="http://www.javascript-examples.com/images/homepage.png" /&gt;&lt;/a&gt;&lt;/span&gt;  &lt;br /&gt;&lt;/div&gt;&lt;div class="post" style="font-family: Arial,Helvetica,sans-serif;"&gt; &lt;div class="date"&gt;&lt;span style="font-size: small;"&gt;&lt;span class="month"&gt;&lt;/span&gt;&lt;span class="day style6"&gt;34&lt;/span&gt;&lt;/span&gt;   &lt;/div&gt;&lt;span style="font-size: small;"&gt;&lt;b&gt;Swazz Javascript Calendar&lt;/b&gt;&lt;br /&gt;&lt;img alt="" height="150" src="http://www.javascript-examples.com/images/javascript-calendars/swazz-javascript-calendar.jpg" width="162" /&gt;&lt;br /&gt;Free javascript calendar, made as lightweight (only 6kb in size!) widget which shows a calendar for use in picking dates on form fields. &lt;br /&gt;&lt;/span&gt;  &lt;br /&gt;&lt;span style="font-size: small;"&gt;&lt;a href="http://calendar.swazz.org/" target="_blank"&gt;&lt;img src="http://www.javascript-examples.com/images/homepage.png" /&gt;&lt;/a&gt;  &lt;a href="http://calendar.swazz.org/example.html" target="_blank"&gt;&lt;img src="http://www.javascript-examples.com/images/view_demo.png" /&gt;&lt;/a&gt; &lt;a href="http://calendar.swazz.org/download/swazzcalendar1.0.zip" target="_blank"&gt;&lt;img src="http://www.javascript-examples.com/images/download.png" /&gt;&lt;/a&gt;&lt;/span&gt; &lt;br /&gt;&lt;/div&gt;&lt;div class="post" style="font-family: Arial,Helvetica,sans-serif;"&gt; &lt;div class="date"&gt;&lt;span style="font-size: small;"&gt;&lt;span class="month"&gt;&lt;/span&gt;&lt;span class="day style6"&gt;35&lt;/span&gt;&lt;/span&gt;   &lt;/div&gt;&lt;span style="font-size: small;"&gt;&lt;b&gt;Start to Finish component&lt;/b&gt;&lt;br /&gt;&lt;img alt="" height="150" src="http://www.javascript-examples.com/images/javascript-calendars/start-to-finish-component.jpg" width="310" /&gt;&lt;br /&gt;A Component to ease user experience in selecting a date range. Prototype framework usage needed. &lt;br /&gt;&lt;/span&gt;  &lt;br /&gt;&lt;span style="font-size: small;"&gt;&lt;a href="http://positionabsolute.net/blog/2007/12/calendar-time-slider.php" target="_blank"&gt;&lt;img src="http://www.javascript-examples.com/images/homepage.png" /&gt;&lt;/a&gt;  &lt;a href="http://positionabsolute.net/blog/2008/01/google-calendar-date-range-selection.php" target="_blank"&gt;&lt;img src="http://www.javascript-examples.com/images/view_demo.png" /&gt;&lt;/a&gt;&lt;/span&gt; &lt;br /&gt;&lt;/div&gt;&lt;div class="post" style="font-family: Arial,Helvetica,sans-serif;"&gt; &lt;div class="date"&gt;&lt;span style="font-size: small;"&gt;&lt;span class="month"&gt;&lt;/span&gt;&lt;span class="day style6"&gt;36&lt;/span&gt;&lt;/span&gt;   &lt;/div&gt;&lt;span style="font-size: small;"&gt;&lt;b&gt;Vista-like Ajax Calendar&lt;/b&gt;&lt;br /&gt;&lt;img alt="" height="154" src="http://www.javascript-examples.com/images/javascript-calendars/vista-like-ajax-calendar.jpg" width="190" /&gt;&lt;br /&gt;The Vista-like Ajax Calendar (vlaCalendar) version 2 is a unobtrusive web version of the slick and profound Windows Vista taskbar calendar, by using the MooTools javascript framework, AJAX, XHTML, CSS and PHP. &lt;br /&gt;&lt;/span&gt;  &lt;br /&gt;&lt;span style="font-size: small;"&gt;&lt;a href="http://dev.base86.com/scripts/vista-like_ajax_calendar_version_2.html" target="_blank"&gt;&lt;img src="http://www.javascript-examples.com/images/homepage.png" /&gt;&lt;/a&gt;  &lt;a href="http://dev.base86.com/scripts/vista-like_ajax_calendar_version_2.html#examples" target="_blank"&gt;&lt;img src="http://www.javascript-examples.com/images/view_demo.png" /&gt;&lt;/a&gt; &lt;a href="http://download.base86.com/?file=vlaCalendar.v2.1.1.zip" target="_blank"&gt;&lt;img src="http://www.javascript-examples.com/images/download.png" /&gt;&lt;/a&gt;&lt;/span&gt; &lt;br /&gt;&lt;/div&gt;&lt;div class="post" style="font-family: Arial,Helvetica,sans-serif;"&gt; &lt;div class="date"&gt;&lt;span style="font-size: small;"&gt;&lt;span class="month"&gt;&lt;/span&gt;&lt;span class="day style6"&gt;37&lt;/span&gt;&lt;/span&gt;   &lt;/div&gt;&lt;span style="font-size: small;"&gt;&lt;b&gt;Unobtrusive Date-Picker Widget&lt;/b&gt;&lt;br /&gt;&lt;img alt="" height="254" src="http://www.javascript-examples.com/images/javascript-calendars/unobtrusive-date-picker-widget.jpg" width="230" /&gt;&lt;br /&gt;DatePicker is accessible using the keyboard, requires no embedded JavaScript blocks, uses no pop-up windows and is suitable for use within documents served as application/xhtml+xml. It’s free to use, even commercially. 16 languages currently available for this calender. &lt;br /&gt;&lt;/span&gt;  &lt;br /&gt;&lt;span style="font-size: small;"&gt;&lt;a href="http://www.frequency-decoder.com/2006/10/02/unobtrusive-date-picker-widgit-update/" target="_blank"&gt;&lt;img src="http://www.javascript-examples.com/images/homepage.png" /&gt;&lt;/a&gt;  &lt;a href="http://www.frequency-decoder.com/demo/date-picker-v2/" target="_blank"&gt;&lt;img src="http://www.javascript-examples.com/images/view_demo.png" /&gt;&lt;/a&gt; &lt;a href="http://www.frequency-decoder.com/demo/date-picker-v2/date-picker.zip" target="_blank"&gt;&lt;img src="http://www.javascript-examples.com/images/download.png" /&gt;&lt;/a&gt;&lt;/span&gt; &lt;br /&gt;&lt;/div&gt;&lt;div class="post" style="font-family: Arial,Helvetica,sans-serif;"&gt; &lt;div class="date"&gt;&lt;span style="font-size: small;"&gt;&lt;span class="month"&gt;&lt;/span&gt;&lt;span class="day style6"&gt;38&lt;/span&gt;&lt;/span&gt;   &lt;/div&gt;&lt;span style="font-size: small;"&gt;&lt;b&gt;Ajax enabled online calendar&lt;/b&gt;&lt;br /&gt;&lt;img alt="" height="293" src="http://www.javascript-examples.com/images/javascript-calendars/ajax-enabled-online-calendar.jpg" width="483" /&gt;&lt;br /&gt;An Ajax enabled online calendar. Drag and drop events to change dates, drag the start/end of an event to create multi-day events, create and edit events without refreshing the page, all with an iCal style interface. This release now works in all major browsers (Firefox, Opera, Safari, and Internet Explorer). Monket Calendar is one of the only web based calendars can displays multi-day events spanning accross the days on which they occur. &lt;br /&gt;&lt;/span&gt;  &lt;br /&gt;&lt;span style="font-size: small;"&gt;&lt;a href="http://monket.net/wiki-v2/Monket_Calendar" target="_blank"&gt;&lt;img src="http://www.javascript-examples.com/images/homepage.png" /&gt;&lt;/a&gt;  &lt;a href="http://www.monket.net/cal/" target="_blank"&gt;&lt;img src="http://www.javascript-examples.com/images/view_demo.png" /&gt;&lt;/a&gt; &lt;a href="http://www.monket.net/files/monket-cal/monket-cal-0.9.1.zip" target="_blank"&gt;&lt;img src="http://www.javascript-examples.com/images/download.png" /&gt;&lt;/a&gt;&lt;/span&gt; &lt;br /&gt;&lt;/div&gt;&lt;script src="http://badged.net/badged.js?u=http%3a%2f%2fwww.javascript-examples.com%2fjavascript-calendars%2f;t=Javascript+Calendars;dl=y;ie=y;em=y;"&gt;&lt;/script&gt;&lt;span style="font-size: small;"&gt;&lt;a href="http://del.icio.us/post?url=http://www.javascript-examples.com/javascript-calendars/&amp;amp;title=Javascript%20Calendars" style="font-family: Arial,Helvetica,sans-serif;" target="_blank"&gt;&lt;img alt="Add to del.icio.us" border="0" src="http://badged.net/ico/delicious.gif" title="Add to del.icio.us" /&gt;&lt;/a&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8707790305856929068-8667767525714356587?l=javascriptfactory.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javascriptfactory.blogspot.com/feeds/8667767525714356587/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://javascriptfactory.blogspot.com/2009/09/javascript-calendars.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8707790305856929068/posts/default/8667767525714356587'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8707790305856929068/posts/default/8667767525714356587'/><link rel='alternate' type='text/html' href='http://javascriptfactory.blogspot.com/2009/09/javascript-calendars.html' title='Javascript Calendars'/><author><name>Vipin C</name><uri>http://www.blogger.com/profile/01967245433419006643</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8707790305856929068.post-9039241471322876280</id><published>2009-09-15T03:31:00.000-07:00</published><updated>2009-09-15T03:31:13.711-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Tutorials'/><category scheme='http://www.blogger.com/atom/ns#' term='Loops'/><title type='text'>The do...while Loop</title><content type='html'>&lt;span style="font-size: small;"&gt;&lt;/span&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;The do...while loop is a variant of the while loop. This loop will  execute the block of code ONCE, and then it will repeat the loop as long as the specified condition is true.&lt;/span&gt;&lt;/div&gt;&lt;h3 style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;i&gt;&lt;span style="font-size: small;"&gt;Syntax&lt;/span&gt;&lt;/i&gt;&lt;/h3&gt;&lt;table border="0" cellpadding="0" cellspacing="0" class="code" style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;span style="font-size: small;"&gt;do&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: small;"&gt;&amp;nbsp; {&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: small;"&gt;&lt;i&gt;&amp;nbsp; code to be executed&lt;br /&gt;&amp;nbsp; &lt;/i&gt;}&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: small;"&gt;while (var&amp;lt;=endvalue);&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;h3 style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;i&gt;&lt;span style="font-size: small;"&gt;Example&lt;/span&gt;&lt;/i&gt;&lt;/h3&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;The example below uses a do...while loop. The do...while loop will always be  executed at least once, even if the condition is false, because the statements  are executed before the condition is tested:&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&amp;lt;html&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&amp;lt;body&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&amp;lt;script&amp;nbsp;type="text/javascript"&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;var&amp;nbsp;i=0;&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;do&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&amp;nbsp;&amp;nbsp;{&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&amp;nbsp;&amp;nbsp;document.write("The&amp;nbsp;number&amp;nbsp;is&amp;nbsp;"&amp;nbsp;+&amp;nbsp;i);&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&amp;nbsp;&amp;nbsp;document.write("&amp;lt;br&amp;nbsp;/&amp;gt;");&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&amp;nbsp;&amp;nbsp;i++;&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&amp;nbsp;&amp;nbsp;}&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;while&amp;nbsp;(i&amp;lt;=5);&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8707790305856929068-9039241471322876280?l=javascriptfactory.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javascriptfactory.blogspot.com/feeds/9039241471322876280/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://javascriptfactory.blogspot.com/2009/09/dowhile-loop.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8707790305856929068/posts/default/9039241471322876280'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8707790305856929068/posts/default/9039241471322876280'/><link rel='alternate' type='text/html' href='http://javascriptfactory.blogspot.com/2009/09/dowhile-loop.html' title='The do...while Loop'/><author><name>Vipin C</name><uri>http://www.blogger.com/profile/01967245433419006643</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8707790305856929068.post-1128011939707431338</id><published>2009-09-15T03:30:00.000-07:00</published><updated>2009-09-15T03:30:06.154-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Tutorials'/><category scheme='http://www.blogger.com/atom/ns#' term='Loops'/><title type='text'>The while Loop</title><content type='html'>&lt;span style="font-size: small;"&gt;&lt;/span&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;The while loop loops through a block of code while a specified condition is true.&lt;/span&gt;&lt;/div&gt;&lt;h3 style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;i&gt;&lt;span style="font-size: small;"&gt;Syntax&lt;/span&gt;&lt;/i&gt;&lt;/h3&gt;&lt;table border="0" cellpadding="0" cellspacing="0" class="code" style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;span style="font-size: small;"&gt;while (var&amp;lt;=endvalue)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: small;"&gt;&amp;nbsp; {&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: small;"&gt;&lt;i&gt;&amp;nbsp; code to be executed&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: small;"&gt;&amp;nbsp; }&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&lt;b&gt;Note:&lt;/b&gt; The &amp;lt;= could be any comparing statement.&lt;/span&gt;&lt;/div&gt;&lt;h3 style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;i&gt;&lt;span style="font-size: small;"&gt;Example&lt;/span&gt;&lt;/i&gt;&lt;/h3&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;The example below defines a loop that starts with i=0. The loop  will continue to run as long as &lt;b&gt;i&lt;/b&gt;&lt;b&gt;i&lt;/b&gt;  will increase by 1 each time the loop runs:&lt;/span&gt; is less than, or equal to 5. &lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&amp;lt;html&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&amp;lt;body&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&amp;lt;script&amp;nbsp;type="text/javascript"&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;var&amp;nbsp;i=0;&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;while&amp;nbsp;(i&amp;lt;=5)&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&amp;nbsp;&amp;nbsp;{&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&amp;nbsp;&amp;nbsp;document.write("The&amp;nbsp;number&amp;nbsp;is&amp;nbsp;"&amp;nbsp;+&amp;nbsp;i);&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&amp;nbsp;&amp;nbsp;document.write("&amp;lt;br&amp;nbsp;/&amp;gt;");&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&amp;nbsp;&amp;nbsp;i++;&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&amp;nbsp;&amp;nbsp;}&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8707790305856929068-1128011939707431338?l=javascriptfactory.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javascriptfactory.blogspot.com/feeds/1128011939707431338/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://javascriptfactory.blogspot.com/2009/09/while-loop.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8707790305856929068/posts/default/1128011939707431338'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8707790305856929068/posts/default/1128011939707431338'/><link rel='alternate' type='text/html' href='http://javascriptfactory.blogspot.com/2009/09/while-loop.html' title='The while Loop'/><author><name>Vipin C</name><uri>http://www.blogger.com/profile/01967245433419006643</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8707790305856929068.post-2688060832378135366</id><published>2009-09-15T03:28:00.000-07:00</published><updated>2009-09-15T03:28:01.599-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Tutorials'/><category scheme='http://www.blogger.com/atom/ns#' term='Loops'/><title type='text'>The for Loop</title><content type='html'>&lt;span style="font-size: small;"&gt;&lt;/span&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;The for loop is used when you know in advance how many times the script should run.&lt;/span&gt;&lt;/div&gt;&lt;h3 style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;i&gt;&lt;span style="font-size: small;"&gt;&lt;b&gt;Syntax&lt;/b&gt;&lt;/span&gt;&lt;/i&gt;&lt;/h3&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;for (var=startvalue;var&amp;lt;=endvalue;var=var+increment)&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;{&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&lt;i&gt;code to be executed&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;}&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;h3 style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;i&gt;&lt;span style="font-size: small;"&gt;&lt;b&gt;Example&lt;/b&gt;&lt;/span&gt;&lt;/i&gt;&lt;/h3&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;The example below defines a loop that starts with i=0. The loop will continue to run as long as &lt;b&gt;i&lt;/b&gt;&lt;b&gt;i&lt;/b&gt;  will increase by 1 each time the loop runs.&lt;/span&gt; is less than, or equal to  5. &lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&lt;b&gt;Note:&lt;/b&gt; The increment parameter could also be negative, and the &amp;lt;= could be any comparing statement.&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&amp;lt;html&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&amp;lt;body&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&amp;lt;script&amp;nbsp;type="text/javascript"&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;var&amp;nbsp;i=0;&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;for&amp;nbsp;(i=0;i&amp;lt;=5;i++)&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;{&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;document.write("The&amp;nbsp;number&amp;nbsp;is&amp;nbsp;"&amp;nbsp;+&amp;nbsp;i);&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;document.write("&amp;lt;br&amp;nbsp;/&amp;gt;");&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;}&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8707790305856929068-2688060832378135366?l=javascriptfactory.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javascriptfactory.blogspot.com/feeds/2688060832378135366/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://javascriptfactory.blogspot.com/2009/09/for-loop.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8707790305856929068/posts/default/2688060832378135366'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8707790305856929068/posts/default/2688060832378135366'/><link rel='alternate' type='text/html' href='http://javascriptfactory.blogspot.com/2009/09/for-loop.html' title='The for Loop'/><author><name>Vipin C</name><uri>http://www.blogger.com/profile/01967245433419006643</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8707790305856929068.post-8608657708757825484</id><published>2009-09-15T03:26:00.001-07:00</published><updated>2009-09-15T03:26:50.097-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Tutorials'/><category scheme='http://www.blogger.com/atom/ns#' term='Loops'/><title type='text'>JavaScript Loops</title><content type='html'>&lt;span style="font-size: small;"&gt;&lt;/span&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;Often when you write code, you want the same block of code to run over and over again in a row. Instead of adding several almost equal lines in a script we can use loops to perform a task like this.&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;In JavaScript, there are two different kind of loops:&lt;/span&gt;&lt;/div&gt;&lt;ul style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;li&gt;&lt;span style="font-size: small;"&gt;&lt;b&gt;for &lt;/b&gt;- loops through a block of code a specified number of times&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size: small;"&gt;&lt;b&gt;while &lt;/b&gt;- loops through a block of code while a specified condition is true&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8707790305856929068-8608657708757825484?l=javascriptfactory.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javascriptfactory.blogspot.com/feeds/8608657708757825484/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://javascriptfactory.blogspot.com/2009/09/javascript-loops.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8707790305856929068/posts/default/8608657708757825484'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8707790305856929068/posts/default/8608657708757825484'/><link rel='alternate' type='text/html' href='http://javascriptfactory.blogspot.com/2009/09/javascript-loops.html' title='JavaScript Loops'/><author><name>Vipin C</name><uri>http://www.blogger.com/profile/01967245433419006643</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8707790305856929068.post-3320960053576978236</id><published>2009-09-15T03:25:00.001-07:00</published><updated>2009-09-15T03:25:44.541-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Variables'/><category scheme='http://www.blogger.com/atom/ns#' term='Tutorials'/><title type='text'>The Lifetime of JavaScript Variables</title><content type='html'>&lt;span style="font-size: small;"&gt;&lt;/span&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;If you declare a variable within a function, the variable can only be accessed within that function. When you exit the function, the variable is destroyed. These variables are called local variables. You can have local variables with the same name in different functions, because each is recognized only by the function in which it is declared.&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;If you declare a variable outside a function, all the functions on your page can access it. The lifetime of these variables starts when they are declared, and ends when the page is closed.&lt;/span&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8707790305856929068-3320960053576978236?l=javascriptfactory.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javascriptfactory.blogspot.com/feeds/3320960053576978236/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://javascriptfactory.blogspot.com/2009/09/lifetime-of-javascript-variables.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8707790305856929068/posts/default/3320960053576978236'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8707790305856929068/posts/default/3320960053576978236'/><link rel='alternate' type='text/html' href='http://javascriptfactory.blogspot.com/2009/09/lifetime-of-javascript-variables.html' title='The Lifetime of JavaScript Variables'/><author><name>Vipin C</name><uri>http://www.blogger.com/profile/01967245433419006643</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8707790305856929068.post-5901730724471993424</id><published>2009-09-15T03:24:00.000-07:00</published><updated>2009-09-15T03:24:58.161-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Return Statement'/><category scheme='http://www.blogger.com/atom/ns#' term='Tutorials'/><title type='text'>The return Statement</title><content type='html'>&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;The return statement is used to specify the value that is returned from the function.&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;So, functions that are going to return a value must use the return statement.&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;The example below returns the product of two numbers (a and b):&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&lt;i&gt;&lt;b&gt;Example&lt;/b&gt;&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&amp;lt;html&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&amp;lt;head&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&amp;lt;script&amp;nbsp;type="text/javascript"&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;function&amp;nbsp;product(a,b)&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;{&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;return&amp;nbsp;a*b;&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;}&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&amp;lt;body&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&amp;lt;script&amp;nbsp;type="text/javascript"&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;document.write(product(4,3));&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8707790305856929068-5901730724471993424?l=javascriptfactory.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javascriptfactory.blogspot.com/feeds/5901730724471993424/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://javascriptfactory.blogspot.com/2009/09/return-statement.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8707790305856929068/posts/default/5901730724471993424'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8707790305856929068/posts/default/5901730724471993424'/><link rel='alternate' type='text/html' href='http://javascriptfactory.blogspot.com/2009/09/return-statement.html' title='The return Statement'/><author><name>Vipin C</name><uri>http://www.blogger.com/profile/01967245433419006643</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8707790305856929068.post-3529676726363185345</id><published>2009-09-15T03:22:00.000-07:00</published><updated>2009-09-15T03:23:33.146-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Functions'/><category scheme='http://www.blogger.com/atom/ns#' term='Examples'/><title type='text'>JavaScript Function Example</title><content type='html'>&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&amp;lt;html&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&amp;lt;head&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&amp;lt;script&amp;nbsp;type="text/javascript"&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;function&amp;nbsp;displaymessage()&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;{&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;alert("Hello&amp;nbsp;World!");&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;}&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&amp;lt;body&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&amp;lt;form&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&amp;lt;input&amp;nbsp;type="button"&amp;nbsp;value="Click&amp;nbsp;me!"&amp;nbsp;onclick="displaymessage()"&amp;nbsp;/&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&amp;lt;/form&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;If the line: alert("Hello world!!") in the example above had not been put  within a function, it would have been executed as soon as the line was loaded.  Now, the script is not executed before a user hits the input button. The function displaymessage()  will be executed if the input button is clicked.&lt;/span&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8707790305856929068-3529676726363185345?l=javascriptfactory.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javascriptfactory.blogspot.com/feeds/3529676726363185345/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://javascriptfactory.blogspot.com/2009/09/javascript-function-example.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8707790305856929068/posts/default/3529676726363185345'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8707790305856929068/posts/default/3529676726363185345'/><link rel='alternate' type='text/html' href='http://javascriptfactory.blogspot.com/2009/09/javascript-function-example.html' title='JavaScript Function Example'/><author><name>Vipin C</name><uri>http://www.blogger.com/profile/01967245433419006643</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8707790305856929068.post-1948707724356599896</id><published>2009-09-15T03:21:00.000-07:00</published><updated>2009-09-15T03:21:25.009-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Functions'/><category scheme='http://www.blogger.com/atom/ns#' term='Tutorials'/><title type='text'>How to Define a Function</title><content type='html'>&lt;span style="font-size: small;"&gt;&lt;/span&gt;&lt;h3 style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&lt;i&gt;Syntax&lt;/i&gt;&lt;/span&gt;&lt;/h3&gt;&lt;table border="0" cellpadding="0" cellspacing="0" class="code" style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;blockquote&gt;&lt;blockquote&gt;&lt;span style="font-size: small;"&gt; function &lt;i&gt;functionname&lt;/i&gt;(&lt;i&gt;var1,var2,...,varX&lt;/i&gt;)&lt;br /&gt;{&lt;br /&gt;&lt;i&gt;some code&lt;/i&gt;&lt;br /&gt;}&lt;/span&gt;&lt;/blockquote&gt;&lt;/blockquote&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;The parameters var1, var2, etc. are variables or values passed into the function. The { and the } defines the start and end of the function.&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&lt;b&gt;Note:&lt;/b&gt; A function with no parameters must include the parentheses ()  after the function name.&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&lt;b&gt;Note:&lt;/b&gt; Do not forget about the importance of capitals in JavaScript!  The word function must be written in lowercase letters, otherwise a JavaScript  error occurs! Also note that you must call a function with the exact same  capitals as in the function name.&lt;br /&gt;&lt;/span&gt; &lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8707790305856929068-1948707724356599896?l=javascriptfactory.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javascriptfactory.blogspot.com/feeds/1948707724356599896/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://javascriptfactory.blogspot.com/2009/09/how-to-define-function.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8707790305856929068/posts/default/1948707724356599896'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8707790305856929068/posts/default/1948707724356599896'/><link rel='alternate' type='text/html' href='http://javascriptfactory.blogspot.com/2009/09/how-to-define-function.html' title='How to Define a Function'/><author><name>Vipin C</name><uri>http://www.blogger.com/profile/01967245433419006643</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8707790305856929068.post-7669399682952057625</id><published>2009-09-15T03:19:00.001-07:00</published><updated>2009-09-15T03:19:53.879-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Functions'/><category scheme='http://www.blogger.com/atom/ns#' term='Tutorials'/><title type='text'>JavaScript Functions</title><content type='html'>&lt;span style="font-size: small;"&gt;&lt;/span&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;To keep the browser from executing a script when the page loads, you can put your script into a function.&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;A function contains code that will be executed by an event or by a call to the function.&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;You may call a function from anywhere within a page (or even from other pages if the function is embedded in an external .js file).&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;Functions can be defined both in the  and in the  section of a document. However, to assure that a function is read/loaded by the browser before it is called, it could be wise to put functions in the  section.&lt;/span&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8707790305856929068-7669399682952057625?l=javascriptfactory.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javascriptfactory.blogspot.com/feeds/7669399682952057625/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://javascriptfactory.blogspot.com/2009/09/javascript-functions.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8707790305856929068/posts/default/7669399682952057625'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8707790305856929068/posts/default/7669399682952057625'/><link rel='alternate' type='text/html' href='http://javascriptfactory.blogspot.com/2009/09/javascript-functions.html' title='JavaScript Functions'/><author><name>Vipin C</name><uri>http://www.blogger.com/profile/01967245433419006643</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8707790305856929068.post-2324192535432022667</id><published>2009-09-15T03:18:00.000-07:00</published><updated>2009-09-15T03:18:54.961-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='PopUp Boxes'/><category scheme='http://www.blogger.com/atom/ns#' term='Tutorials'/><title type='text'>JavaScript Popup Boxes : Prompt Box</title><content type='html'>&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;A prompt box is often used if you want the user to input a value before entering a page.&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;When a prompt box pops up, the user will have to click either "OK" or "Cancel" to proceed after entering an input value. &lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;If the user clicks "OK" the box returns the input value. If the user clicks "Cancel" the box returns null.&lt;/span&gt;&lt;/div&gt;&lt;h3 style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;i&gt;&lt;span style="font-size: x-small;"&gt;&lt;b&gt;Syntax&lt;/b&gt;&lt;/span&gt;&lt;/i&gt;&lt;/h3&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;prompt("sometext","defaultvalue");&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;i&gt;&lt;span style="font-size: x-small;"&gt;&lt;b&gt;Example&lt;/b&gt;&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&amp;lt;html&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&amp;lt;head&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&amp;lt;script&amp;nbsp;type="text/javascript"&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;function&amp;nbsp;show_prompt()&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;{&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;var&amp;nbsp;name=prompt("Please&amp;nbsp;enter&amp;nbsp;your&amp;nbsp;name","Harry&amp;nbsp;Potter");&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;if&amp;nbsp;(name!=null&amp;nbsp;&amp;amp;&amp;amp;&amp;nbsp;name!="")&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&amp;nbsp;&amp;nbsp;{&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&amp;nbsp;&amp;nbsp;document.write("Hello&amp;nbsp;"&amp;nbsp;+&amp;nbsp;name&amp;nbsp;+&amp;nbsp;"!&amp;nbsp;How&amp;nbsp;are&amp;nbsp;you&amp;nbsp;today?");&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&amp;nbsp;&amp;nbsp;}&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;}&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&amp;lt;body&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&amp;lt;input&amp;nbsp;type="button"&amp;nbsp;onclick="show_prompt()"&amp;nbsp;value="Show&amp;nbsp;prompt&amp;nbsp;box"&amp;nbsp;/&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8707790305856929068-2324192535432022667?l=javascriptfactory.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javascriptfactory.blogspot.com/feeds/2324192535432022667/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://javascriptfactory.blogspot.com/2009/09/javascript-popup-boxes-prompt-box.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8707790305856929068/posts/default/2324192535432022667'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8707790305856929068/posts/default/2324192535432022667'/><link rel='alternate' type='text/html' href='http://javascriptfactory.blogspot.com/2009/09/javascript-popup-boxes-prompt-box.html' title='JavaScript Popup Boxes : Prompt Box'/><author><name>Vipin C</name><uri>http://www.blogger.com/profile/01967245433419006643</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8707790305856929068.post-1436942723402927642</id><published>2009-09-15T03:17:00.000-07:00</published><updated>2009-09-15T03:17:22.946-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='PopUp Boxes'/><category scheme='http://www.blogger.com/atom/ns#' term='Tutorials'/><title type='text'>JavaScript Popup Boxes : Confirm Box</title><content type='html'>&lt;span style="font-size: small;"&gt;&lt;/span&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;A confirm box is often used if you want the user to verify or accept something.&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;When a confirm box pops up, the user will have to click either "OK" or "Cancel" to proceed. &lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;If the user clicks "OK", the box returns true. If the user clicks "Cancel", the box returns false.&lt;/span&gt;&lt;/div&gt;&lt;h3 style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;i&gt;&lt;span style="font-size: x-small;"&gt;&lt;b&gt;Syntax&lt;/b&gt;&lt;/span&gt;&lt;/i&gt;&lt;/h3&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;confirm("sometext");&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;i&gt;&lt;span style="font-size: x-small;"&gt;&lt;b&gt;Example&lt;/b&gt;&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&amp;lt;html&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&amp;lt;head&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&amp;lt;script&amp;nbsp;type="text/javascript"&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;function&amp;nbsp;show_confirm()&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;{&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;var&amp;nbsp;r=confirm("Press&amp;nbsp;a&amp;nbsp;button");&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;if&amp;nbsp;(r==true)&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&amp;nbsp;&amp;nbsp;{&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&amp;nbsp;&amp;nbsp;document.write("You&amp;nbsp;pressed&amp;nbsp;OK!");&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&amp;nbsp;&amp;nbsp;}&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;else&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&amp;nbsp;&amp;nbsp;{&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&amp;nbsp;&amp;nbsp;document.write("You&amp;nbsp;pressed&amp;nbsp;Cancel!");&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&amp;nbsp;&amp;nbsp;}&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;}&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&amp;lt;body&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&amp;lt;input&amp;nbsp;type="button"&amp;nbsp;onclick="show_confirm()"&amp;nbsp;value="Show&amp;nbsp;confirm&amp;nbsp;box"&amp;nbsp;/&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8707790305856929068-1436942723402927642?l=javascriptfactory.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javascriptfactory.blogspot.com/feeds/1436942723402927642/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://javascriptfactory.blogspot.com/2009/09/javascript-popup-boxes-confirm-box.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8707790305856929068/posts/default/1436942723402927642'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8707790305856929068/posts/default/1436942723402927642'/><link rel='alternate' type='text/html' href='http://javascriptfactory.blogspot.com/2009/09/javascript-popup-boxes-confirm-box.html' title='JavaScript Popup Boxes : Confirm Box'/><author><name>Vipin C</name><uri>http://www.blogger.com/profile/01967245433419006643</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8707790305856929068.post-8655401504667306513</id><published>2009-09-15T03:15:00.000-07:00</published><updated>2009-09-15T03:15:33.973-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='PopUp Boxes'/><category scheme='http://www.blogger.com/atom/ns#' term='Tutorials'/><title type='text'>JavaScript Popup Boxes : Alert Box</title><content type='html'>&lt;span style="font-size: small;"&gt;&lt;/span&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;An alert box is often used if you want to make sure information comes through to the user.&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;When an alert box pops up, the user will have to click "OK" to proceed. &lt;/span&gt;&lt;/div&gt;&lt;h3 style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;i&gt;&lt;span style="font-size: x-small;"&gt;&lt;b&gt;Syntax&lt;/b&gt;&lt;/span&gt;&lt;/i&gt;&lt;/h3&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;alert("sometext");&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;i&gt;&lt;span style="font-size: x-small;"&gt;&lt;b&gt;Example&lt;/b&gt;&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&amp;lt;html&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&amp;lt;head&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&amp;lt;script&amp;nbsp;type="text/javascript"&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;function&amp;nbsp;show_alert()&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;{&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;alert("I&amp;nbsp;am&amp;nbsp;an&amp;nbsp;alert&amp;nbsp;box!");&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;}&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&amp;lt;body&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&amp;lt;input&amp;nbsp;type="button"&amp;nbsp;onclick="show_alert()"&amp;nbsp;value="Show&amp;nbsp;alert&amp;nbsp;box"&amp;nbsp;/&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8707790305856929068-8655401504667306513?l=javascriptfactory.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javascriptfactory.blogspot.com/feeds/8655401504667306513/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://javascriptfactory.blogspot.com/2009/09/javascript-popup-boxes-alert-box.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8707790305856929068/posts/default/8655401504667306513'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8707790305856929068/posts/default/8655401504667306513'/><link rel='alternate' type='text/html' href='http://javascriptfactory.blogspot.com/2009/09/javascript-popup-boxes-alert-box.html' title='JavaScript Popup Boxes : Alert Box'/><author><name>Vipin C</name><uri>http://www.blogger.com/profile/01967245433419006643</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8707790305856929068.post-8851417862043495631</id><published>2009-09-15T03:11:00.000-07:00</published><updated>2009-09-15T03:13:28.633-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Statements'/><category scheme='http://www.blogger.com/atom/ns#' term='Tutorials'/><title type='text'>JavaScript Switch Statement</title><content type='html'>&lt;span style="font-size: small;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;Use the switch statement to select one of many blocks of code to be executed.&lt;/span&gt;&lt;/div&gt;&lt;h3 style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;i&gt;&lt;span style="font-size: x-small;"&gt;Syntax&lt;/span&gt;&lt;/i&gt;&lt;/h3&gt;&lt;table border="0" cellpadding="0" cellspacing="0" class="code" style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;blockquote&gt;&lt;span style="font-size: small;"&gt; switch(n)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: small;"&gt; {&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: small;"&gt; case 1:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: small;"&gt;&lt;i&gt;&amp;nbsp; execute code block 1&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: small;"&gt;   &amp;nbsp;   break;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: small;"&gt; case 2:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: small;"&gt;&lt;i&gt;&amp;nbsp; execute code block 2&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: small;"&gt;   &amp;nbsp;   break;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: small;"&gt; default:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: small;"&gt;&lt;i&gt;&amp;nbsp; code to be executed if n is different from case 1 and 2&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: small;"&gt; }&lt;/span&gt;&lt;/blockquote&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;This is how it works: First we have a single expression &lt;i&gt;n&lt;/i&gt; (most often a variable), that is evaluated once. The value of the expression is then compared with the values for each case in the structure. If there is a match, the block of code associated with that case is executed. Use &lt;b&gt;break&lt;/b&gt; to prevent the code from running into the next case automatically.&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;br /&gt;&lt;i&gt;&lt;span style="font-size: x-small;"&gt;&lt;b&gt;Example&lt;/b&gt;&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;  &lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;  &lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;br /&gt;&lt;span style="font-size: small;"&gt; &lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt; &lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;span style="font-size: small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: small;"&gt;&amp;lt;script&amp;nbsp;type="text/javascript"&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: small;"&gt;//You&amp;nbsp;will&amp;nbsp;receive&amp;nbsp;a&amp;nbsp;different&amp;nbsp;greeting&amp;nbsp;based&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: small;"&gt;//on&amp;nbsp;what&amp;nbsp;day&amp;nbsp;it&amp;nbsp;is.&amp;nbsp;Note&amp;nbsp;that&amp;nbsp;Sunday=0,&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: small;"&gt;//Monday=1,&amp;nbsp;Tuesday=2,&amp;nbsp;etc.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: small;"&gt;var&amp;nbsp;d=new&amp;nbsp;Date();&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: small;"&gt;theDay=d.getDay();&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: small;"&gt;switch&amp;nbsp;(theDay)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: small;"&gt;{&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: small;"&gt;case&amp;nbsp;5:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: small;"&gt;&amp;nbsp;&amp;nbsp;document.write("Finally&amp;nbsp;Friday");&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: small;"&gt;&amp;nbsp;&amp;nbsp;break;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: small;"&gt;case&amp;nbsp;6:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: small;"&gt;&amp;nbsp;&amp;nbsp;document.write("Super&amp;nbsp;Saturday");&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: small;"&gt;&amp;nbsp;&amp;nbsp;break;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: small;"&gt;case&amp;nbsp;0:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: small;"&gt;&amp;nbsp;&amp;nbsp;document.write("Sleepy&amp;nbsp;Sunday");&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: small;"&gt;&amp;nbsp;&amp;nbsp;break;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: small;"&gt;default:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: small;"&gt;&amp;nbsp;&amp;nbsp;document.write("I'm&amp;nbsp;looking&amp;nbsp;forward&amp;nbsp;to&amp;nbsp;this&amp;nbsp;weekend!");&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: small;"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: small;"&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8707790305856929068-8851417862043495631?l=javascriptfactory.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javascriptfactory.blogspot.com/feeds/8851417862043495631/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://javascriptfactory.blogspot.com/2009/09/javascript-switch-statement.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8707790305856929068/posts/default/8851417862043495631'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8707790305856929068/posts/default/8851417862043495631'/><link rel='alternate' type='text/html' href='http://javascriptfactory.blogspot.com/2009/09/javascript-switch-statement.html' title='JavaScript Switch Statement'/><author><name>Vipin C</name><uri>http://www.blogger.com/profile/01967245433419006643</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8707790305856929068.post-6976473927596704148</id><published>2009-09-15T03:09:00.000-07:00</published><updated>2009-09-15T03:09:50.238-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Tutorials'/><title type='text'>If...else if...else Statement</title><content type='html'>&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;Use the if....else if...else statement to select one of several blocks of code to be executed.&lt;/div&gt;&lt;h3 style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: x-small;"&gt;Syntax&lt;/span&gt;&lt;/h3&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;   if (&lt;i&gt;condition1&lt;/i&gt;)&lt;br /&gt;&amp;nbsp; {&lt;br /&gt;&lt;i&gt;&amp;nbsp; code to be executed if condition1 is true&lt;/i&gt;&lt;br /&gt;&amp;nbsp; }&lt;br /&gt;else if (&lt;i&gt;condition2&lt;/i&gt;)&lt;br /&gt;&amp;nbsp; {&lt;br /&gt;&lt;i&gt;&amp;nbsp; code to be executed if condition2 is true&lt;/i&gt;&lt;br /&gt;&amp;nbsp; }&lt;br /&gt;else&lt;br /&gt;&amp;nbsp; {&lt;br /&gt;&lt;i&gt;&amp;nbsp; code to be executed if condition1 and condition2 are not true&lt;/i&gt;&lt;br /&gt;&amp;nbsp; }&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;/div&gt;&lt;h2 class="example" style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: x-small;"&gt;Example&lt;/span&gt;&lt;/h2&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;/div&gt;&lt;br /&gt;&amp;#60;script&amp;#160;type=&amp;#34;text/javascript&amp;#34;&amp;#62;&lt;br /&gt;var&amp;#160;d&amp;#160;=&amp;#160;new&amp;#160;Date()&lt;br /&gt;var&amp;#160;time&amp;#160;=&amp;#160;d.getHours()&lt;br /&gt;if&amp;#160;(time&amp;#60;10)&lt;br /&gt;&amp;#160;&amp;#160;{&lt;br /&gt;&amp;#160;&amp;#160;document.write(&amp;#34;&amp;#60;b&amp;#62;Good&amp;#160;morning&amp;#60;/b&amp;#62;&amp;#34;);&lt;br /&gt;&amp;#160;&amp;#160;}&lt;br /&gt;else&amp;#160;if&amp;#160;(time&amp;#62;10&amp;#160;&amp;&amp;&amp;#160;time&amp;#60;16)&lt;br /&gt;&amp;#160;&amp;#160;{&lt;br /&gt;&amp;#160;&amp;#160;document.write(&amp;#34;&amp;#60;b&amp;#62;Good&amp;#160;day&amp;#60;/b&amp;#62;&amp;#34;);&lt;br /&gt;&amp;#160;&amp;#160;}&lt;br /&gt;else&lt;br /&gt;&amp;#160;&amp;#160;{&lt;br /&gt;&amp;#160;&amp;#160;document.write(&amp;#34;&amp;#60;b&amp;#62;Hello&amp;#160;World!&amp;#60;/b&amp;#62;&amp;#34;);&lt;br /&gt;&amp;#160;&amp;#160;}&lt;br /&gt;&amp;#60;/script&amp;#62;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8707790305856929068-6976473927596704148?l=javascriptfactory.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javascriptfactory.blogspot.com/feeds/6976473927596704148/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://javascriptfactory.blogspot.com/2009/09/ifelse-ifelse-statement.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8707790305856929068/posts/default/6976473927596704148'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8707790305856929068/posts/default/6976473927596704148'/><link rel='alternate' type='text/html' href='http://javascriptfactory.blogspot.com/2009/09/ifelse-ifelse-statement.html' title='If...else if...else Statement'/><author><name>Vipin C</name><uri>http://www.blogger.com/profile/01967245433419006643</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8707790305856929068.post-8622103117882447338</id><published>2009-09-15T03:08:00.000-07:00</published><updated>2009-09-15T03:08:06.201-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Tutorials'/><title type='text'>If...else Statement</title><content type='html'>&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;Use the if....else statement to execute some code if a condition is true and  another code if the condition is not true.&lt;/div&gt;&lt;h3 style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: x-small;"&gt;Syntax&lt;/span&gt;&lt;/h3&gt;&lt;table border="0" cellpadding="0" cellspacing="0" class="code" style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt; if (&lt;i&gt;condition&lt;/i&gt;)&lt;br /&gt;&amp;nbsp; {&lt;br /&gt;&lt;i&gt;&amp;nbsp; code to be executed if condition is true&lt;/i&gt;&lt;br /&gt;&amp;nbsp; }&lt;br /&gt;else&lt;br /&gt;&amp;nbsp; {&lt;br /&gt;&lt;i&gt;&amp;nbsp; code to be executed if condition is not true&lt;/i&gt;&lt;br /&gt;&amp;nbsp; }&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br style="font-family: Arial,Helvetica,sans-serif;" /&gt;   &lt;h2 class="example" style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: x-small;"&gt;Example&lt;/span&gt;&lt;/h2&gt;&lt;h2 class="example" style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: x-small;"&gt;&amp;nbsp; &lt;br /&gt;&lt;/span&gt;&lt;/h2&gt;&amp;#60;script&amp;#160;type=&amp;#34;text/javascript&amp;#34;&amp;#62;&lt;br /&gt;//If&amp;#160;the&amp;#160;time&amp;#160;is&amp;#160;less&amp;#160;than&amp;#160;10,&amp;#160;you&amp;#160;will&amp;#160;get&amp;#160;a&amp;#160;&amp;#34;Good&amp;#160;morning&amp;#34;&amp;#160;greeting.&lt;br /&gt;//Otherwise&amp;#160;you&amp;#160;will&amp;#160;get&amp;#160;a&amp;#160;&amp;#34;Good&amp;#160;day&amp;#34;&amp;#160;greeting.&lt;br /&gt;&lt;br /&gt;var&amp;#160;d&amp;#160;=&amp;#160;new&amp;#160;Date();&lt;br /&gt;var&amp;#160;time&amp;#160;=&amp;#160;d.getHours();&lt;br /&gt;&lt;br /&gt;if&amp;#160;(time&amp;#160;&amp;#60;&amp;#160;10)&lt;br /&gt;&amp;#160;&amp;#160;{&lt;br /&gt;&amp;#160;&amp;#160;document.write(&amp;#34;Good&amp;#160;morning!&amp;#34;);&lt;br /&gt;&amp;#160;&amp;#160;}&lt;br /&gt;else&lt;br /&gt;&amp;#160;&amp;#160;{&lt;br /&gt;&amp;#160;&amp;#160;document.write(&amp;#34;Good&amp;#160;day!&amp;#34;);&lt;br /&gt;&amp;#160;&amp;#160;}&lt;br /&gt;&amp;#60;/script&amp;#62;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8707790305856929068-8622103117882447338?l=javascriptfactory.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javascriptfactory.blogspot.com/feeds/8622103117882447338/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://javascriptfactory.blogspot.com/2009/09/ifelse-statement.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8707790305856929068/posts/default/8622103117882447338'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8707790305856929068/posts/default/8622103117882447338'/><link rel='alternate' type='text/html' href='http://javascriptfactory.blogspot.com/2009/09/ifelse-statement.html' title='If...else Statement'/><author><name>Vipin C</name><uri>http://www.blogger.com/profile/01967245433419006643</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8707790305856929068.post-2784070779766609397</id><published>2009-09-14T23:15:00.000-07:00</published><updated>2009-09-14T23:15:06.542-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Operators'/><category scheme='http://www.blogger.com/atom/ns#' term='Tutorials'/><category scheme='http://www.blogger.com/atom/ns#' term='Examples'/><title type='text'>Triple equals in JavaScript</title><content type='html'>&lt;span style="font-size: small;"&gt;&lt;/span&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;I think I'm a pretty decent javascript programmer, so it's always refreshing to learn something new in a language I'm so familiar with! I recently had some time to watch those great lectures from Doug Crockford at YUI Theatre, and noticed lots of &lt;span style="font-weight: bold;"&gt;===&lt;/span&gt; in the code. &lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;That's right, it's not a typo, but 3 equal signs, and it means &lt;span style="font-style: italic; font-weight: bold;"&gt;equality without type coersion&lt;/span&gt;. In other words, if using the triple equals, the values must be equal in type as well.&lt;/span&gt;&lt;/div&gt;&lt;span style="font-size: small;"&gt;&lt;span style="font-family: Arial,Helvetica,sans-serif;"&gt; e.g. &lt;/span&gt;&lt;/span&gt;&lt;blockquote style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;pre class="code"&gt;&lt;span style="font-size: small;"&gt;&lt;em&gt;0==false   // true&lt;br /&gt;0===false  // false, because they are of a different type&lt;br /&gt;1=="1"     // true, auto type coersion&lt;br /&gt;1==="1"    // false, because they are of a different type&lt;br /&gt;&lt;/em&gt;&lt;/span&gt;&lt;/pre&gt;&lt;/blockquote&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;Another handy tool in my javascript bag of tricks, as recommended by Mr father of javascript himself!&lt;/span&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8707790305856929068-2784070779766609397?l=javascriptfactory.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javascriptfactory.blogspot.com/feeds/2784070779766609397/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://javascriptfactory.blogspot.com/2009/09/triple-equals-in-javascript.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8707790305856929068/posts/default/2784070779766609397'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8707790305856929068/posts/default/2784070779766609397'/><link rel='alternate' type='text/html' href='http://javascriptfactory.blogspot.com/2009/09/triple-equals-in-javascript.html' title='Triple equals in JavaScript'/><author><name>Vipin C</name><uri>http://www.blogger.com/profile/01967245433419006643</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8707790305856929068.post-2958714062572156656</id><published>2009-09-06T23:14:00.000-07:00</published><updated>2009-09-06T23:17:10.680-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Statements'/><category scheme='http://www.blogger.com/atom/ns#' term='Examples'/><title type='text'>If Statement</title><content type='html'>&lt;p  style="font-family:arial;"&gt;&lt;span style="font-size:85%;"&gt;Use the if statement to execute some code only if a specified condition is true.&lt;/span&gt;&lt;/p&gt;  &lt;h3  style="font-weight: normal; font-style: italic;font-family:arial;"&gt;&lt;span style="font-size:85%;"&gt;Syntax&lt;/span&gt;&lt;/h3&gt; &lt;table  class="code" width="100%" border="0" cellpadding="0" cellspacing="0" style="font-family:arial;"&gt; &lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;span style="font-size:85%;"&gt; &lt;span style="font-weight: bold;"&gt;if (&lt;/span&gt;&lt;i style="font-weight: bold;"&gt;condition&lt;/i&gt;&lt;span style="font-weight: bold;"&gt;)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;   {&lt;/span&gt;&lt;br /&gt;&lt;i style="font-weight: bold;"&gt;  code to be executed if condition is true&lt;/i&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;   }&lt;/span&gt;&lt;/span&gt; &lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;  &lt;p  style="font-family:arial;"&gt;&lt;span style="font-size:85%;"&gt;Note that if is written in lowercase letters. Using uppercase letters (IF) will generate a JavaScript error!&lt;/span&gt;&lt;/p&gt;   &lt;h2  style="font-weight: normal; font-style: italic;font-family:arial;" class="example"&gt;&lt;span style="font-size:85%;"&gt;Example&lt;/span&gt;&lt;/h2&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:arial;"&gt;&lt;script type="text/javascript"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;//Write a "Good morning" greeting if&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;//the time is less than 10&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;var d=new Date();&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;var time=d.getHours();&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;if (time&lt;10)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;  {&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;  document.write("&lt;b&gt;Good morning&lt;/b&gt;");&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;  }&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;&lt;/script&gt;&lt;/span&gt;&amp;#60;script&amp;#160;type=&amp;#34;text/javascript&amp;#34;&amp;#62;&lt;br /&gt;//Write&amp;#160;a&amp;#160;&amp;#34;Good&amp;#160;morning&amp;#34;&amp;#160;greeting&amp;#160;if&lt;br /&gt;//the&amp;#160;time&amp;#160;is&amp;#160;less&amp;#160;than&amp;#160;10&lt;br /&gt;&lt;br /&gt;var&amp;#160;d=new&amp;#160;Date();&lt;br /&gt;var&amp;#160;time=d.getHours();&lt;br /&gt;&lt;br /&gt;if&amp;#160;(time&amp;#60;10)&lt;br /&gt;&amp;#160;&amp;#160;{&lt;br /&gt;&amp;#160;&amp;#160;document.write(&amp;#34;&amp;#60;b&amp;#62;Good&amp;#160;morning&amp;#60;/b&amp;#62;&amp;#34;);&lt;br /&gt;&amp;#160;&amp;#160;}&lt;br /&gt;&amp;#60;/script&amp;#62;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:arial;font-size:85%;"  &gt; &lt;script type="text/javascript"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt; //Write a "Good morning" greeting if&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt; //the time is less than 10&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt; var d=new Date();&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt; var time=d.getHours();&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt; if (time&lt;10)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;   {&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;   document.write("&lt;b&gt;Good morning&lt;/b&gt;");&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;   }&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt; &lt;/script&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8707790305856929068-2958714062572156656?l=javascriptfactory.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javascriptfactory.blogspot.com/feeds/2958714062572156656/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://javascriptfactory.blogspot.com/2009/09/if-statement.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8707790305856929068/posts/default/2958714062572156656'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8707790305856929068/posts/default/2958714062572156656'/><link rel='alternate' type='text/html' href='http://javascriptfactory.blogspot.com/2009/09/if-statement.html' title='If Statement'/><author><name>Vipin C</name><uri>http://www.blogger.com/profile/01967245433419006643</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8707790305856929068.post-7310742335085898846</id><published>2009-09-06T23:13:00.000-07:00</published><updated>2009-09-06T23:14:29.033-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Statements'/><category scheme='http://www.blogger.com/atom/ns#' term='Tutorials'/><title type='text'>JavaScript Conditional Statements</title><content type='html'>&lt;p style="font-family: arial;"&gt;&lt;span style="font-size:85%;"&gt;Very often when you write code, you want to perform different actions for different decisions. You can use conditional statements in your code to do this.&lt;/span&gt;&lt;/p&gt; &lt;p style="font-family: arial;"&gt;&lt;span style="font-size:85%;"&gt;In JavaScript we have the following conditional statements:&lt;/span&gt;&lt;/p&gt; &lt;ul style="font-family: arial;"&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;&lt;b&gt;if statement&lt;/b&gt; - use this statement to execute some code only if a specified condition is true&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;&lt;b&gt;if...else statement&lt;/b&gt; - use this statement to execute some code if the condition is true and another code if the condition is false&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;&lt;b&gt;if...else if....else statement&lt;/b&gt;  - use this statement to select one of many blocks of code to be executed&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;&lt;b&gt;switch statement&lt;/b&gt; - use this statement to select one of many blocks of code to be executed&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8707790305856929068-7310742335085898846?l=javascriptfactory.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javascriptfactory.blogspot.com/feeds/7310742335085898846/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://javascriptfactory.blogspot.com/2009/09/javascript-conditional-statements.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8707790305856929068/posts/default/7310742335085898846'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8707790305856929068/posts/default/7310742335085898846'/><link rel='alternate' type='text/html' href='http://javascriptfactory.blogspot.com/2009/09/javascript-conditional-statements.html' title='JavaScript Conditional Statements'/><author><name>Vipin C</name><uri>http://www.blogger.com/profile/01967245433419006643</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8707790305856929068.post-6619153919076396468</id><published>2009-09-06T23:12:00.000-07:00</published><updated>2009-09-06T23:13:37.745-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Operators'/><category scheme='http://www.blogger.com/atom/ns#' term='Examples'/><title type='text'>Conditional Operator</title><content type='html'>&lt;p style="font-family: arial;"&gt;&lt;span style="font-size:85%;"&gt;JavaScript also contains a conditional operator that assigns a value to a variable based on some condition.&lt;/span&gt;&lt;/p&gt; &lt;h3 style="font-family: arial; font-style: italic;"&gt;&lt;span style="font-size:85%;"&gt;Syntax&lt;/span&gt;&lt;/h3&gt;  &lt;table style="font-family: arial; font-weight: bold;" class="code" width="100%" border="0" cellpadding="0" cellspacing="0"&gt; &lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;span style="font-size:85%;"&gt;variablename=(condition)?value1:value2 &lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;  &lt;h3 style="font-family: arial; font-style: italic;"&gt;&lt;span style="font-size:85%;"&gt;Example&lt;/span&gt;&lt;/h3&gt;  &lt;table style="font-family: arial; font-weight: bold;" class="code" width="100%" border="0" cellpadding="0" cellspacing="0"&gt; &lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;span style="font-size:85%;"&gt;greeting=(visitor=="PRES")?"Dear President ":"Dear ";&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;  &lt;p style="font-family: arial;"&gt;&lt;span style="font-size:85%;"&gt;If the variable &lt;b&gt;visitor&lt;/b&gt; has the value of "PRES", then the variable &lt;b&gt;greeting&lt;/b&gt; will be assigned the value "Dear President " else it will be assigned "Dear".&lt;/span&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8707790305856929068-6619153919076396468?l=javascriptfactory.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javascriptfactory.blogspot.com/feeds/6619153919076396468/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://javascriptfactory.blogspot.com/2009/09/conditional-operator.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8707790305856929068/posts/default/6619153919076396468'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8707790305856929068/posts/default/6619153919076396468'/><link rel='alternate' type='text/html' href='http://javascriptfactory.blogspot.com/2009/09/conditional-operator.html' title='Conditional Operator'/><author><name>Vipin C</name><uri>http://www.blogger.com/profile/01967245433419006643</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8707790305856929068.post-875426152770522976</id><published>2009-09-06T23:11:00.002-07:00</published><updated>2009-09-06T23:12:42.726-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Operators'/><category scheme='http://www.blogger.com/atom/ns#' term='Examples'/><title type='text'>Logical Operators</title><content type='html'>&lt;p style="font-family: arial;"&gt;&lt;span style="font-size:85%;"&gt;Logical operators are used to determine the logic between variables or values.&lt;/span&gt;&lt;/p&gt; &lt;p style="font-family: arial;"&gt;&lt;span style="font-size:85%;"&gt;Given that &lt;b&gt;x=6 and y=3&lt;/b&gt;, the table below explains the logical operators: &lt;/span&gt;&lt;/p&gt;   &lt;table style="font-family: arial;" class="reference" width="100%" border="1" cellpadding="0" cellspacing="0"&gt;&lt;tbody&gt;&lt;tr&gt; &lt;th width="15%" align="left"&gt;&lt;span style="font-size:85%;"&gt;Operator&lt;/span&gt;&lt;/th&gt; &lt;th width="45%" align="left"&gt;&lt;span style="font-size:85%;"&gt;Description&lt;/span&gt;&lt;/th&gt; &lt;th width="40%" align="left"&gt;&lt;span style="font-size:85%;"&gt;Example&lt;/span&gt;&lt;/th&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td valign="top"&gt;&lt;span style="font-size:85%;"&gt;&amp;amp;&amp;amp;&lt;/span&gt;&lt;/td&gt; &lt;td valign="top"&gt;&lt;span style="font-size:85%;"&gt;and&lt;/span&gt;&lt;/td&gt; &lt;td valign="top"&gt;&lt;span style="font-size:85%;"&gt; (x &amp;lt; 10 &amp;amp;&amp;amp; y &amp;gt; 1) is true&lt;/span&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td valign="top"&gt;&lt;span style="font-size:85%;"&gt;||&lt;/span&gt;&lt;/td&gt; &lt;td valign="top"&gt;&lt;span style="font-size:85%;"&gt;or&lt;/span&gt;&lt;/td&gt; &lt;td valign="top"&gt;&lt;span style="font-size:85%;"&gt;(x==5 || y==5) is false&lt;/span&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td valign="top"&gt;&lt;span style="font-size:85%;"&gt;!&lt;/span&gt;&lt;/td&gt; &lt;td valign="top"&gt;&lt;span style="font-size:85%;"&gt;not&lt;/span&gt;&lt;/td&gt; &lt;td valign="top"&gt;&lt;span style="font-size:85%;"&gt; !(x==y) is true&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8707790305856929068-875426152770522976?l=javascriptfactory.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javascriptfactory.blogspot.com/feeds/875426152770522976/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://javascriptfactory.blogspot.com/2009/09/logical-operators.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8707790305856929068/posts/default/875426152770522976'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8707790305856929068/posts/default/875426152770522976'/><link rel='alternate' type='text/html' href='http://javascriptfactory.blogspot.com/2009/09/logical-operators.html' title='Logical Operators'/><author><name>Vipin C</name><uri>http://www.blogger.com/profile/01967245433419006643</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8707790305856929068.post-3643906887578484334</id><published>2009-09-06T23:11:00.001-07:00</published><updated>2009-09-06T23:11:42.481-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Examples'/><title type='text'>Example of using comparison operator</title><content type='html'>&lt;p  style="font-family:arial;"&gt;&lt;span style="font-size:85%;"&gt;Comparison operators can be used in conditional statements to compare values  and take action depending on the result:&lt;/span&gt;&lt;/p&gt;   &lt;span style="font-weight: bold;font-size:85%;" &gt;&lt;span style="font-family:arial;"&gt;if (age&amp;lt;18) document.write("Too young");&lt;/span&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8707790305856929068-3643906887578484334?l=javascriptfactory.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javascriptfactory.blogspot.com/feeds/3643906887578484334/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://javascriptfactory.blogspot.com/2009/09/example-of-using-comparison-operator.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8707790305856929068/posts/default/3643906887578484334'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8707790305856929068/posts/default/3643906887578484334'/><link rel='alternate' type='text/html' href='http://javascriptfactory.blogspot.com/2009/09/example-of-using-comparison-operator.html' title='Example of using comparison operator'/><author><name>Vipin C</name><uri>http://www.blogger.com/profile/01967245433419006643</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8707790305856929068.post-8007342934298838595</id><published>2009-09-06T22:57:00.000-07:00</published><updated>2009-09-06T23:08:57.519-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Tutorials'/><title type='text'>Comparison Operators</title><content type='html'>&lt;p  style="font-family:arial;"&gt;&lt;span style="font-size:85%;"&gt;Comparison operators are used in logical statements to determine equality or difference between variables or values. &lt;/span&gt;&lt;/p&gt; &lt;p  style="font-family:arial;"&gt;&lt;span style="font-size:85%;"&gt;Given that &lt;b&gt;x=5&lt;/b&gt;, the table below explains the comparison operators:&lt;/span&gt;&lt;/p&gt;   &lt;table class="reference"  width="100%" border="1" cellpadding="0" cellspacing="0" style="font-family:arial;"&gt;&lt;tbody&gt;&lt;tr&gt; &lt;th width="15%" align="left"&gt;&lt;span style="font-size:85%;"&gt;Operator&lt;/span&gt;&lt;/th&gt; &lt;th width="45%" align="left"&gt;&lt;span style="font-size:85%;"&gt;Description&lt;/span&gt;&lt;/th&gt; &lt;th width="40%" align="left"&gt;&lt;span style="font-size:85%;"&gt;Example&lt;/span&gt;&lt;/th&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td valign="top"&gt;&lt;span style="font-size:85%;"&gt;==&lt;/span&gt;&lt;/td&gt; &lt;td valign="top"&gt;&lt;span style="font-size:85%;"&gt;is equal to &lt;/span&gt;&lt;/td&gt; &lt;td valign="top"&gt;&lt;span style="font-size:85%;"&gt;x==8 is false &lt;/span&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td valign="top"&gt;&lt;span style="font-size:85%;"&gt;===&lt;/span&gt;&lt;/td&gt; &lt;td valign="top"&gt;&lt;span style="font-size:85%;"&gt;is exactly equal to (value and type)&lt;/span&gt;&lt;/td&gt; &lt;td valign="top"&gt;&lt;span style="font-size:85%;"&gt;x===5 is true&lt;br /&gt;x==="5" is false&lt;/span&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td valign="top"&gt;&lt;span style="font-size:85%;"&gt;!=&lt;/span&gt;&lt;/td&gt; &lt;td valign="top"&gt;&lt;span style="font-size:85%;"&gt;is not equal&lt;/span&gt;&lt;/td&gt; &lt;td valign="top"&gt;&lt;span style="font-size:85%;"&gt;x!=8 is true&lt;/span&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td valign="top"&gt;&lt;span style="font-size:85%;"&gt;&amp;gt;&lt;/span&gt;&lt;/td&gt; &lt;td valign="top"&gt;&lt;span style="font-size:85%;"&gt;is greater than&lt;/span&gt;&lt;/td&gt; &lt;td valign="top"&gt;&lt;span style="font-size:85%;"&gt;x&amp;gt;8 is false&lt;/span&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td valign="top"&gt;&lt;span style="font-size:85%;"&gt;&amp;lt;&lt;/span&gt;&lt;/td&gt; &lt;td valign="top"&gt;&lt;span style="font-size:85%;"&gt;is less than&lt;/span&gt;&lt;/td&gt; &lt;td valign="top"&gt;&lt;span style="font-size:85%;"&gt;x&amp;lt;8&lt;/span&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td valign="top"&gt;&lt;span style="font-size:85%;"&gt;&amp;gt;=&lt;/span&gt;&lt;/td&gt; &lt;td valign="top"&gt;&lt;span style="font-size:85%;"&gt;is greater than or equal to&lt;/span&gt;&lt;/td&gt; &lt;td valign="top"&gt;&lt;span style="font-size:85%;"&gt;x&amp;gt;=8 is false&lt;/span&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td valign="top"&gt;&lt;span style="font-size:85%;"&gt;&amp;lt;=&lt;/span&gt;&lt;/td&gt; &lt;td valign="top"&gt;&lt;span style="font-size:85%;"&gt;is less than or equal to&lt;/span&gt;&lt;/td&gt; &lt;td valign="top"&gt;&lt;span style="font-size:85%;"&gt;x&amp;lt;=8 is true&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8707790305856929068-8007342934298838595?l=javascriptfactory.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javascriptfactory.blogspot.com/feeds/8007342934298838595/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://javascriptfactory.blogspot.com/2009/09/comparison-operators.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8707790305856929068/posts/default/8007342934298838595'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8707790305856929068/posts/default/8007342934298838595'/><link rel='alternate' type='text/html' href='http://javascriptfactory.blogspot.com/2009/09/comparison-operators.html' title='Comparison Operators'/><author><name>Vipin C</name><uri>http://www.blogger.com/profile/01967245433419006643</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8707790305856929068.post-1632727230126783413</id><published>2009-09-06T22:56:00.000-07:00</published><updated>2009-09-06T22:57:20.827-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Tutorials'/><category scheme='http://www.blogger.com/atom/ns#' term='Examples'/><title type='text'>Adding Strings and Numbers</title><content type='html'>&lt;p style="font-family: arial;"&gt;&lt;span style="font-size:85%;"&gt;The rule is: &lt;b&gt;If you add a number and a string, the result will be a string!&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;   &lt;h2 style="font-family: arial; font-style: italic; font-weight: normal;" class="example"&gt;&lt;span style="font-size:85%;"&gt;Example&lt;/span&gt;&lt;/h2&gt; &lt;span style="font-size:85%;"&gt;&lt;span style="font-family: arial;"&gt; &lt;span style="font-weight: bold;"&gt;x=5+5;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: arial; font-weight: bold;"&gt; document.write(x);&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: arial; font-weight: bold;"&gt; x="5"+"5";&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: arial; font-weight: bold;"&gt; document.write(x);&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: arial; font-weight: bold;"&gt; x=5+"5";&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: arial; font-weight: bold;"&gt; document.write(x);&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: arial; font-weight: bold;"&gt; x="5"+5;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: arial; font-weight: bold;"&gt; document.write(x); &lt;/span&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8707790305856929068-1632727230126783413?l=javascriptfactory.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javascriptfactory.blogspot.com/feeds/1632727230126783413/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://javascriptfactory.blogspot.com/2009/09/adding-strings-and-numbers.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8707790305856929068/posts/default/1632727230126783413'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8707790305856929068/posts/default/1632727230126783413'/><link rel='alternate' type='text/html' href='http://javascriptfactory.blogspot.com/2009/09/adding-strings-and-numbers.html' title='Adding Strings and Numbers'/><author><name>Vipin C</name><uri>http://www.blogger.com/profile/01967245433419006643</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8707790305856929068.post-8929821903959377870</id><published>2009-09-06T22:55:00.000-07:00</published><updated>2009-09-06T22:56:04.629-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Tutorials'/><category scheme='http://www.blogger.com/atom/ns#' term='Examples'/><title type='text'>The + Operator Used on Strings</title><content type='html'>&lt;p style="font-family: arial;"&gt;&lt;span style="font-size:85%;"&gt;The + operator can also be used to add string variables or text values together.&lt;/span&gt;&lt;/p&gt; &lt;p style="font-family: arial;"&gt;&lt;span style="font-size:85%;"&gt;To add two or more string variables together, use the + operator.&lt;/span&gt;&lt;/p&gt;  &lt;table style="font-family: arial;" class="code" width="100%" border="0" cellpadding="0" cellspacing="0"&gt; &lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;span style="font-size:85%;"&gt; &lt;span style="font-weight: bold;"&gt;txt1="What a very";&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt; txt2="nice day";&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt; txt3=txt1+txt2;&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt; &lt;/tbody&gt;&lt;/table&gt;  &lt;p style="font-family: arial;"&gt;&lt;span style="font-size:85%;"&gt;After the execution of the statements above, the variable txt3 contains "What a verynice day".&lt;/span&gt;&lt;/p&gt; &lt;p style="font-family: arial;"&gt;&lt;span style="font-size:85%;"&gt;To add a space between the two strings, insert a space into one of the strings:&lt;/span&gt;&lt;/p&gt;  &lt;table style="font-family: arial;" class="code" width="100%" border="0" cellpadding="0" cellspacing="0"&gt; &lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;span style="font-size:85%;"&gt; &lt;span style="font-weight: bold;"&gt;txt1="What a very ";&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt; txt2="nice day";&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt; txt3=txt1+txt2;&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;  &lt;p style="font-family: arial;"&gt;&lt;span style="font-size:85%;"&gt;or insert a space into the expression:&lt;/span&gt;&lt;/p&gt;  &lt;table style="font-family: arial;" class="code" width="100%" border="0" cellpadding="0" cellspacing="0"&gt; &lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;span style="font-size:85%;"&gt; &lt;span style="font-weight: bold;"&gt;txt1="What a very";&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt; txt2="nice day";&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt; txt3=txt1+" "+txt2;&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;  &lt;p style="font-family: arial;"&gt;&lt;span style="font-size:85%;"&gt;After the execution of the statements above, the variable txt3 contains:&lt;/span&gt;&lt;/p&gt; &lt;p style="font-family: arial;"&gt;&lt;span style="font-size:85%;"&gt;"What a very nice day"&lt;/span&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8707790305856929068-8929821903959377870?l=javascriptfactory.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javascriptfactory.blogspot.com/feeds/8929821903959377870/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://javascriptfactory.blogspot.com/2009/09/operator-used-on-strings.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8707790305856929068/posts/default/8929821903959377870'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8707790305856929068/posts/default/8929821903959377870'/><link rel='alternate' type='text/html' href='http://javascriptfactory.blogspot.com/2009/09/operator-used-on-strings.html' title='The + Operator Used on Strings'/><author><name>Vipin C</name><uri>http://www.blogger.com/profile/01967245433419006643</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8707790305856929068.post-4271580866902516989</id><published>2009-09-06T22:54:00.000-07:00</published><updated>2009-09-06T22:55:21.134-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Tutorials'/><title type='text'>JavaScript Assignment Operators</title><content type='html'>&lt;p style="font-family: arial;"&gt;&lt;span style="font-size:85%;"&gt;Assignment operators are used to assign values to JavaScript variables.&lt;/span&gt;&lt;/p&gt; &lt;p style="font-family: arial;"&gt;&lt;span style="font-size:85%;"&gt;Given that &lt;b&gt;x=10&lt;/b&gt; and &lt;b&gt;y=5&lt;/b&gt;, the table below explains the assignment operators:&lt;/span&gt;&lt;/p&gt;  &lt;table style="font-family: arial;" class="reference" width="100%" border="1" cellpadding="0" cellspacing="0"&gt; &lt;tbody&gt;&lt;tr&gt; &lt;th width="15%" align="left"&gt;&lt;span style="font-size:85%;"&gt;Operator&lt;/span&gt;&lt;/th&gt; &lt;th width="40%" align="left"&gt;&lt;span style="font-size:85%;"&gt;Example&lt;/span&gt;&lt;/th&gt; &lt;th width="25%" align="left"&gt;&lt;span style="font-size:85%;"&gt;Same As&lt;/span&gt;&lt;/th&gt; &lt;th width="20%" align="left"&gt;&lt;span style="font-size:85%;"&gt;Result&lt;/span&gt;&lt;/th&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td valign="top"&gt;&lt;span style="font-size:85%;"&gt;=&lt;/span&gt;&lt;/td&gt; &lt;td valign="top"&gt;&lt;span style="font-size:85%;"&gt;x=y&lt;/span&gt;&lt;/td&gt; &lt;td valign="top"&gt;&lt;span style="font-size:85%;"&gt; &lt;/span&gt;&lt;/td&gt; &lt;td valign="top"&gt;&lt;span style="font-size:85%;"&gt;x=5&lt;/span&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td valign="top"&gt;&lt;span style="font-size:85%;"&gt;+=&lt;/span&gt;&lt;/td&gt; &lt;td valign="top"&gt;&lt;span style="font-size:85%;"&gt;x+=y&lt;/span&gt;&lt;/td&gt; &lt;td valign="top"&gt;&lt;span style="font-size:85%;"&gt;x=x+y&lt;/span&gt;&lt;/td&gt; &lt;td valign="top"&gt;&lt;span style="font-size:85%;"&gt;x=15&lt;/span&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td valign="top"&gt;&lt;span style="font-size:85%;"&gt;-=&lt;/span&gt;&lt;/td&gt; &lt;td valign="top"&gt;&lt;span style="font-size:85%;"&gt;x-=y&lt;/span&gt;&lt;/td&gt; &lt;td valign="top"&gt;&lt;span style="font-size:85%;"&gt;x=x-y&lt;/span&gt;&lt;/td&gt; &lt;td valign="top"&gt;&lt;span style="font-size:85%;"&gt;x=5&lt;/span&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td valign="top"&gt;&lt;span style="font-size:85%;"&gt;*=&lt;/span&gt;&lt;/td&gt; &lt;td valign="top"&gt;&lt;span style="font-size:85%;"&gt;x*=y&lt;/span&gt;&lt;/td&gt; &lt;td valign="top"&gt;&lt;span style="font-size:85%;"&gt;x=x*y&lt;/span&gt;&lt;/td&gt; &lt;td valign="top"&gt;&lt;span style="font-size:85%;"&gt;x=50&lt;/span&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td valign="top"&gt;&lt;span style="font-size:85%;"&gt;/=&lt;/span&gt;&lt;/td&gt; &lt;td valign="top"&gt;&lt;span style="font-size:85%;"&gt;x/=y&lt;/span&gt;&lt;/td&gt; &lt;td valign="top"&gt;&lt;span style="font-size:85%;"&gt;x=x/y&lt;/span&gt;&lt;/td&gt; &lt;td valign="top"&gt;&lt;span style="font-size:85%;"&gt;x=2&lt;/span&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td valign="top"&gt;&lt;span style="font-size:85%;"&gt;%=&lt;/span&gt;&lt;/td&gt; &lt;td valign="top"&gt;&lt;span style="font-size:85%;"&gt;x%=y&lt;/span&gt;&lt;/td&gt; &lt;td valign="top"&gt;&lt;span style="font-size:85%;"&gt;x=x%y&lt;/span&gt;&lt;/td&gt; &lt;td valign="top"&gt;&lt;span style="font-size:85%;"&gt;x=0&lt;/span&gt;&lt;/td&gt; &lt;/tr&gt; &lt;/tbody&gt;&lt;/table&gt; &lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt; &lt;hr style="font-family: arial; height: 2px;"&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8707790305856929068-4271580866902516989?l=javascriptfactory.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javascriptfactory.blogspot.com/feeds/4271580866902516989/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://javascriptfactory.blogspot.com/2009/09/javascript-assignment-operators.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8707790305856929068/posts/default/4271580866902516989'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8707790305856929068/posts/default/4271580866902516989'/><link rel='alternate' type='text/html' href='http://javascriptfactory.blogspot.com/2009/09/javascript-assignment-operators.html' title='JavaScript Assignment Operators'/><author><name>Vipin C</name><uri>http://www.blogger.com/profile/01967245433419006643</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8707790305856929068.post-6303265836785197938</id><published>2009-09-06T22:53:00.000-07:00</published><updated>2009-09-06T22:54:31.455-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Tutorials'/><title type='text'>JavaScript Arithmetic Operators</title><content type='html'>&lt;p style="font-family: arial;"&gt;&lt;span style="font-size:85%;"&gt;Arithmetic operators are used to perform arithmetic between variables and/or values.&lt;/span&gt;&lt;/p&gt; &lt;p style="font-family: arial;"&gt;&lt;span style="font-size:85%;"&gt;Given that &lt;b&gt;y=5&lt;/b&gt;, the table below explains the arithmetic operators: &lt;/span&gt;&lt;/p&gt;  &lt;table style="font-family: arial;" class="reference" width="100%" border="1" cellpadding="0" cellspacing="0"&gt; &lt;tbody&gt;&lt;tr&gt; &lt;th width="15%" align="left"&gt;&lt;span style="font-size:85%;"&gt;Operator&lt;/span&gt;&lt;/th&gt; &lt;th width="40%" align="left"&gt;&lt;span style="font-size:85%;"&gt;Description&lt;/span&gt;&lt;/th&gt; &lt;th width="25%" align="left"&gt;&lt;span style="font-size:85%;"&gt;Example&lt;/span&gt;&lt;/th&gt; &lt;th width="20%" align="left"&gt;&lt;span style="font-size:85%;"&gt;Result&lt;/span&gt;&lt;/th&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td valign="top"&gt;&lt;span style="font-size:85%;"&gt;+&lt;/span&gt;&lt;/td&gt; &lt;td valign="top"&gt;&lt;span style="font-size:85%;"&gt;Addition&lt;/span&gt;&lt;/td&gt; &lt;td valign="top"&gt;&lt;span style="font-size:85%;"&gt;x=y+2&lt;/span&gt;&lt;/td&gt; &lt;td valign="top"&gt;&lt;span style="font-size:85%;"&gt;x=7&lt;/span&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td valign="top"&gt;&lt;span style="font-size:85%;"&gt;-&lt;/span&gt;&lt;/td&gt; &lt;td valign="top"&gt;&lt;span style="font-size:85%;"&gt;Subtraction&lt;/span&gt;&lt;/td&gt; &lt;td valign="top"&gt;&lt;span style="font-size:85%;"&gt;x=y-2&lt;/span&gt;&lt;/td&gt; &lt;td valign="top"&gt;&lt;span style="font-size:85%;"&gt;x=3&lt;/span&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td valign="top"&gt;&lt;span style="font-size:85%;"&gt;*&lt;/span&gt;&lt;/td&gt; &lt;td valign="top"&gt;&lt;span style="font-size:85%;"&gt;Multiplication&lt;/span&gt;&lt;/td&gt; &lt;td valign="top"&gt;&lt;span style="font-size:85%;"&gt;x=y*2&lt;/span&gt;&lt;/td&gt; &lt;td valign="top"&gt;&lt;span style="font-size:85%;"&gt;x=10&lt;/span&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td valign="top"&gt;&lt;span style="font-size:85%;"&gt;/&lt;/span&gt;&lt;/td&gt; &lt;td valign="top"&gt;&lt;span style="font-size:85%;"&gt;Division&lt;/span&gt;&lt;/td&gt; &lt;td valign="top"&gt;&lt;span style="font-size:85%;"&gt;x=y/2&lt;/span&gt;&lt;/td&gt; &lt;td valign="top"&gt;&lt;span style="font-size:85%;"&gt;x=2.5&lt;/span&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td valign="top"&gt;&lt;span style="font-size:85%;"&gt;%&lt;/span&gt;&lt;/td&gt; &lt;td valign="top"&gt;&lt;span style="font-size:85%;"&gt;Modulus (division remainder)&lt;/span&gt;&lt;/td&gt; &lt;td valign="top"&gt;&lt;span style="font-size:85%;"&gt;x=y%2&lt;/span&gt;&lt;/td&gt; &lt;td valign="top"&gt;&lt;span style="font-size:85%;"&gt;x=1&lt;/span&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td valign="top"&gt;&lt;span style="font-size:85%;"&gt;++&lt;/span&gt;&lt;/td&gt; &lt;td valign="top"&gt;&lt;span style="font-size:85%;"&gt;Increment&lt;/span&gt;&lt;/td&gt; &lt;td valign="top"&gt;&lt;span style="font-size:85%;"&gt;x=++y&lt;/span&gt;&lt;/td&gt; &lt;td valign="top"&gt;&lt;span style="font-size:85%;"&gt;x=6&lt;/span&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td valign="top"&gt;&lt;span style="font-size:85%;"&gt;--&lt;/span&gt;&lt;/td&gt; &lt;td valign="top"&gt;&lt;span style="font-size:85%;"&gt;Decrement&lt;/span&gt;&lt;/td&gt; &lt;td valign="top"&gt;&lt;span style="font-size:85%;"&gt;x=--y&lt;/span&gt;&lt;/td&gt; &lt;td valign="top"&gt;&lt;span style="font-size:85%;"&gt;x=4&lt;/span&gt;&lt;/td&gt; &lt;/tr&gt; &lt;/tbody&gt;&lt;/table&gt; &lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt; &lt;hr style="font-family: arial; height: 2px;"&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8707790305856929068-6303265836785197938?l=javascriptfactory.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javascriptfactory.blogspot.com/feeds/6303265836785197938/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://javascriptfactory.blogspot.com/2009/09/javascript-arithmetic-operators.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8707790305856929068/posts/default/6303265836785197938'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8707790305856929068/posts/default/6303265836785197938'/><link rel='alternate' type='text/html' href='http://javascriptfactory.blogspot.com/2009/09/javascript-arithmetic-operators.html' title='JavaScript Arithmetic Operators'/><author><name>Vipin C</name><uri>http://www.blogger.com/profile/01967245433419006643</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8707790305856929068.post-2017665403606559777</id><published>2009-09-06T22:52:00.002-07:00</published><updated>2009-09-06T22:53:36.924-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Tutorials'/><category scheme='http://www.blogger.com/atom/ns#' term='Examples'/><title type='text'>JavaScript Operators</title><content type='html'>&lt;p style="font-family: arial;" class="intro"&gt;&lt;span style="font-size:85%;"&gt;= is used to assign values.&lt;/span&gt;&lt;/p&gt; &lt;p style="font-family: arial;" class="intro"&gt;&lt;span style="font-size:85%;"&gt;+ is used to add values.&lt;/span&gt;&lt;/p&gt; &lt;hr style="font-family: arial; height: 2px;"&gt; &lt;p style="font-family: arial;"&gt;&lt;span style="font-size:85%;"&gt;The assignment operator &lt;b&gt;=&lt;/b&gt; is used to assign values to JavaScript variables.&lt;/span&gt;&lt;/p&gt; &lt;p style="font-family: arial;"&gt;&lt;span style="font-size:85%;"&gt;The arithmetic operator + is used to add values together.&lt;/span&gt;&lt;/p&gt;  &lt;table style="font-family: arial;" class="code" width="100%" border="0" cellpadding="0" cellspacing="0"&gt; &lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;span style="font-size:85%;"&gt; &lt;span style="font-weight: bold;"&gt;y=5;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt; z=2;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt; x=y+z;&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;  &lt;p style="font-family: arial;"&gt;&lt;span style="font-size:85%;"&gt;The value of x, after the execution of the statements above is 7.&lt;/span&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8707790305856929068-2017665403606559777?l=javascriptfactory.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javascriptfactory.blogspot.com/feeds/2017665403606559777/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://javascriptfactory.blogspot.com/2009/09/javascript-operators.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8707790305856929068/posts/default/2017665403606559777'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8707790305856929068/posts/default/2017665403606559777'/><link rel='alternate' type='text/html' href='http://javascriptfactory.blogspot.com/2009/09/javascript-operators.html' title='JavaScript Operators'/><author><name>Vipin C</name><uri>http://www.blogger.com/profile/01967245433419006643</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8707790305856929068.post-7896456401182461702</id><published>2009-09-06T22:52:00.001-07:00</published><updated>2009-09-06T22:52:49.183-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Tutorials'/><title type='text'>JavaScript Arithmetic</title><content type='html'>&lt;p style="font-family: arial;"&gt;&lt;span style="font-size:85%;"&gt;As with algebra, you can do arithmetic operations with JavaScript variables:&lt;/span&gt;&lt;/p&gt;    &lt;span style="font-size:85%;"&gt;&lt;span style="font-weight: bold; font-family: arial;"&gt;y=x-5;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-family: arial;"&gt; z=y+5;&lt;/span&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8707790305856929068-7896456401182461702?l=javascriptfactory.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javascriptfactory.blogspot.com/feeds/7896456401182461702/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://javascriptfactory.blogspot.com/2009/09/javascript-arithmetic.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8707790305856929068/posts/default/7896456401182461702'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8707790305856929068/posts/default/7896456401182461702'/><link rel='alternate' type='text/html' href='http://javascriptfactory.blogspot.com/2009/09/javascript-arithmetic.html' title='JavaScript Arithmetic'/><author><name>Vipin C</name><uri>http://www.blogger.com/profile/01967245433419006643</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8707790305856929068.post-4350647316057730740</id><published>2009-09-06T22:51:00.002-07:00</published><updated>2009-09-06T22:52:16.342-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Tutorials'/><title type='text'>Redeclaring JavaScript Variables</title><content type='html'>&lt;p style="font-family: arial;"&gt;&lt;span style="font-size:85%;"&gt;If you redeclare a JavaScript variable, it will not lose its original value.&lt;/span&gt;&lt;/p&gt; &lt;table style="font-family: arial;" class="code" width="100%" border="0" cellpadding="0" cellspacing="0"&gt; &lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;span style="font-size:85%;"&gt; &lt;span style="font-weight: bold;"&gt;var x=5;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt; var x;&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;  &lt;p style="font-family: arial;"&gt;&lt;span style="font-size:85%;"&gt;After the execution of the statements above, the variable x will still have  the value of 5. The value of x is not reset (or cleared) when you redeclare it.&lt;/span&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8707790305856929068-4350647316057730740?l=javascriptfactory.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javascriptfactory.blogspot.com/feeds/4350647316057730740/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://javascriptfactory.blogspot.com/2009/09/redeclaring-javascript-variables.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8707790305856929068/posts/default/4350647316057730740'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8707790305856929068/posts/default/4350647316057730740'/><link rel='alternate' type='text/html' href='http://javascriptfactory.blogspot.com/2009/09/redeclaring-javascript-variables.html' title='Redeclaring JavaScript Variables'/><author><name>Vipin C</name><uri>http://www.blogger.com/profile/01967245433419006643</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8707790305856929068.post-7493022028939134914</id><published>2009-09-06T22:51:00.001-07:00</published><updated>2009-09-06T22:51:47.991-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Tutorials'/><title type='text'>Assigning Values to Undeclared JavaScript Variables</title><content type='html'>&lt;p style="font-family: arial;"&gt;&lt;span style="font-size:85%;"&gt;If you assign values to variables that have not yet been declared, the variables will automatically be declared.&lt;/span&gt;&lt;/p&gt; &lt;p style="font-family: arial;"&gt;&lt;span style="font-size:85%;"&gt;These statements:&lt;/span&gt;&lt;/p&gt;  &lt;table style="font-family: arial;" class="code" width="100%" border="0" cellpadding="0" cellspacing="0"&gt; &lt;tbody&gt;&lt;tr&gt;&lt;td&gt; &lt;span style="font-size:85%;"&gt;&lt;span style="font-weight: bold;"&gt;x=5;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt; carname="Volvo";&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;  &lt;p style="font-family: arial;"&gt;&lt;span style="font-size:85%;"&gt;have the same effect as:&lt;/span&gt;&lt;/p&gt; &lt;table style="font-family: arial;" class="code" width="100%" border="0" cellpadding="0" cellspacing="0"&gt; &lt;tbody&gt;&lt;tr&gt;&lt;td&gt; &lt;span style="font-size:85%;"&gt;&lt;span style="font-weight: bold;"&gt;var x=5;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt; var carname="Volvo";&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8707790305856929068-7493022028939134914?l=javascriptfactory.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javascriptfactory.blogspot.com/feeds/7493022028939134914/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://javascriptfactory.blogspot.com/2009/09/assigning-values-to-undeclared.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8707790305856929068/posts/default/7493022028939134914'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8707790305856929068/posts/default/7493022028939134914'/><link rel='alternate' type='text/html' href='http://javascriptfactory.blogspot.com/2009/09/assigning-values-to-undeclared.html' title='Assigning Values to Undeclared JavaScript Variables'/><author><name>Vipin C</name><uri>http://www.blogger.com/profile/01967245433419006643</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8707790305856929068.post-6833139466555319881</id><published>2009-09-06T22:50:00.000-07:00</published><updated>2009-09-06T22:51:12.406-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Tutorials'/><title type='text'>Declaring (Creating) JavaScript Variables</title><content type='html'>&lt;p style="font-family: arial;"&gt;&lt;span style="font-size:85%;"&gt;Creating variables in JavaScript is most often referred to as "declaring" variables.&lt;/span&gt;&lt;/p&gt; &lt;p style="font-family: arial;"&gt;&lt;span style="font-size:85%;"&gt;You can declare JavaScript variables with the &lt;b&gt;var statement&lt;/b&gt;:&lt;/span&gt;&lt;/p&gt;  &lt;table style="font-family: arial;" class="code" width="100%" border="0" cellpadding="0" cellspacing="0"&gt; &lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;span style="font-size:85%;"&gt; &lt;span style="font-weight: bold;"&gt;var x;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt; var carname;&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;  &lt;p style="font-family: arial;"&gt;&lt;span style="font-size:85%;"&gt;After the declaration shown above, the variables are empty (they have no values yet).&lt;/span&gt;&lt;/p&gt; &lt;p style="font-family: arial;"&gt;&lt;span style="font-size:85%;"&gt;However, you can also assign values to the variables when you declare them:&lt;/span&gt;&lt;/p&gt;  &lt;table style="font-family: arial;" class="code" width="100%" border="0" cellpadding="0" cellspacing="0"&gt; &lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;span style="font-size:85%;"&gt; &lt;span style="font-weight: bold;"&gt;var x=5;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt; var carname="Volvo";&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;  &lt;p style="font-family: arial;"&gt;&lt;span style="font-size:85%;"&gt;After the execution of the statements above, the variable &lt;b&gt;x&lt;/b&gt; will hold the value &lt;b&gt;5&lt;/b&gt;, and &lt;b&gt;carname&lt;/b&gt; will hold the value &lt;b&gt;Volvo&lt;/b&gt;.&lt;/span&gt;&lt;/p&gt; &lt;p style="font-family: arial;"&gt;&lt;span style="font-size:85%;"&gt;&lt;b&gt;Note:&lt;/b&gt; When you assign a text value to a variable, use quotes around the value.&lt;/span&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8707790305856929068-6833139466555319881?l=javascriptfactory.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javascriptfactory.blogspot.com/feeds/6833139466555319881/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://javascriptfactory.blogspot.com/2009/09/declaring-creating-javascript-variables.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8707790305856929068/posts/default/6833139466555319881'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8707790305856929068/posts/default/6833139466555319881'/><link rel='alternate' type='text/html' href='http://javascriptfactory.blogspot.com/2009/09/declaring-creating-javascript-variables.html' title='Declaring (Creating) JavaScript Variables'/><author><name>Vipin C</name><uri>http://www.blogger.com/profile/01967245433419006643</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8707790305856929068.post-7108555711270039064</id><published>2009-09-06T22:49:00.002-07:00</published><updated>2009-09-06T22:50:24.356-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Tutorials'/><title type='text'>JavaScript Variables</title><content type='html'>&lt;p style="font-family: arial;"&gt;&lt;span style="font-size:85%;"&gt;As with algebra, JavaScript variables are used to hold values or expressions.&lt;/span&gt;&lt;/p&gt; &lt;p style="font-family: arial;"&gt;&lt;span style="font-size:85%;"&gt;A variable can have a short name, like x, or a more descriptive name, like carname.&lt;/span&gt;&lt;/p&gt; &lt;p style="font-family: arial;"&gt;&lt;span style="font-size:85%;"&gt;Rules for JavaScript variable names:&lt;/span&gt;&lt;/p&gt; &lt;ul style="font-family: arial;"&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;Variable names are case sensitive (y and Y are two different variables)&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;Variable names must begin with a letter or the underscore character&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt; &lt;p style="font-family: arial;"&gt;&lt;span style="font-size:85%;"&gt;&lt;b&gt;Note:&lt;/b&gt; Because JavaScript is case-sensitive, variable names are case-sensitive.&lt;/span&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8707790305856929068-7108555711270039064?l=javascriptfactory.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javascriptfactory.blogspot.com/feeds/7108555711270039064/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://javascriptfactory.blogspot.com/2009/09/javascript-variables.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8707790305856929068/posts/default/7108555711270039064'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8707790305856929068/posts/default/7108555711270039064'/><link rel='alternate' type='text/html' href='http://javascriptfactory.blogspot.com/2009/09/javascript-variables.html' title='JavaScript Variables'/><author><name>Vipin C</name><uri>http://www.blogger.com/profile/01967245433419006643</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8707790305856929068.post-5484266595202792837</id><published>2009-09-06T22:49:00.001-07:00</published><updated>2009-09-06T22:49:49.196-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Tutorials'/><title type='text'>Do You Remember Algebra From School?</title><content type='html'>&lt;p style="font-family: arial;"&gt;&lt;span style="font-size:85%;"&gt;Do you remember algebra from school? x=5, y=6, z=x+y&lt;/span&gt;&lt;/p&gt; &lt;p style="font-family: arial;"&gt;&lt;span style="font-size:85%;"&gt;Do you remember that a letter (like x) could be used to hold a value (like 5), and that you could use the information above to calculate the value of z to be 11?&lt;/span&gt;&lt;/p&gt; &lt;p style="font-family: arial;"&gt;&lt;span style="font-size:85%;"&gt;These letters are called &lt;b&gt;variables&lt;/b&gt;, and variables can be used to hold values (x=5) or expressions (z=x+y).&lt;/span&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8707790305856929068-5484266595202792837?l=javascriptfactory.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javascriptfactory.blogspot.com/feeds/5484266595202792837/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://javascriptfactory.blogspot.com/2009/09/do-you-remember-algebra-from-school.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8707790305856929068/posts/default/5484266595202792837'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8707790305856929068/posts/default/5484266595202792837'/><link rel='alternate' type='text/html' href='http://javascriptfactory.blogspot.com/2009/09/do-you-remember-algebra-from-school.html' title='Do You Remember Algebra From School?'/><author><name>Vipin C</name><uri>http://www.blogger.com/profile/01967245433419006643</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8707790305856929068.post-1936040533576477247</id><published>2009-08-28T06:51:00.000-07:00</published><updated>2009-08-28T06:52:05.699-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Tutorials'/><title type='text'>Redeclaring JavaScript Variables</title><content type='html'>&lt;p style="font-family: arial;"&gt;&lt;span style="font-size:85%;"&gt;If you redeclare a JavaScript variable, it will not lose its original value.&lt;/span&gt;&lt;/p&gt; &lt;table style="font-family: arial;" class="code" width="100%" border="0" cellpadding="0" cellspacing="0"&gt; &lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;span style="font-size:85%;"&gt; &lt;span style="font-weight: bold;"&gt;var x=5;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt; var x;&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;  &lt;p style="font-family: arial;"&gt;&lt;span style="font-size:85%;"&gt;After the execution of the statements above, the variable x will still have  the value of 5. The value of x is not reset (or cleared) when you redeclare it.&lt;/span&gt;&lt;/p&gt; &lt;hr style="font-family: arial; height: 2px;"&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8707790305856929068-1936040533576477247?l=javascriptfactory.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javascriptfactory.blogspot.com/feeds/1936040533576477247/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://javascriptfactory.blogspot.com/2009/08/redeclaring-javascript-variables.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8707790305856929068/posts/default/1936040533576477247'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8707790305856929068/posts/default/1936040533576477247'/><link rel='alternate' type='text/html' href='http://javascriptfactory.blogspot.com/2009/08/redeclaring-javascript-variables.html' title='Redeclaring JavaScript Variables'/><author><name>Vipin C</name><uri>http://www.blogger.com/profile/01967245433419006643</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8707790305856929068.post-8640655785488169368</id><published>2009-08-28T06:50:00.000-07:00</published><updated>2009-08-28T06:51:25.051-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Tutorials'/><title type='text'>Assigning Values to Undeclared JavaScript Variables</title><content type='html'>&lt;p style="font-family: arial;"&gt;&lt;span style="font-size:85%;"&gt;If you assign values to variables that have not yet been declared, the variables will automatically be declared.&lt;/span&gt;&lt;/p&gt; &lt;p style="font-family: arial;"&gt;&lt;span style="font-size:85%;"&gt;These statements:&lt;/span&gt;&lt;/p&gt;  &lt;table style="font-family: arial;" class="code" width="100%" border="0" cellpadding="0" cellspacing="0"&gt; &lt;tbody&gt;&lt;tr&gt;&lt;td&gt; &lt;span style="font-size:85%;"&gt;&lt;span style="font-weight: bold;"&gt;x=5;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt; carname="Volvo";&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;  &lt;p style="font-family: arial;"&gt;&lt;span style="font-size:85%;"&gt;have the same effect as:&lt;/span&gt;&lt;/p&gt;   &lt;span style="font-size:85%;"&gt;&lt;span style="font-weight: bold; font-family: arial;"&gt;var x=5;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-family: arial;"&gt; var carname="Volvo";&lt;/span&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8707790305856929068-8640655785488169368?l=javascriptfactory.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javascriptfactory.blogspot.com/feeds/8640655785488169368/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://javascriptfactory.blogspot.com/2009/08/assigning-values-to-undeclared.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8707790305856929068/posts/default/8640655785488169368'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8707790305856929068/posts/default/8640655785488169368'/><link rel='alternate' type='text/html' href='http://javascriptfactory.blogspot.com/2009/08/assigning-values-to-undeclared.html' title='Assigning Values to Undeclared JavaScript Variables'/><author><name>Vipin C</name><uri>http://www.blogger.com/profile/01967245433419006643</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8707790305856929068.post-3477724227158202965</id><published>2009-08-28T06:49:00.002-07:00</published><updated>2009-08-28T06:50:26.021-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Tutorials'/><category scheme='http://www.blogger.com/atom/ns#' term='Examples'/><title type='text'>Declaring (Creating) JavaScript Variables</title><content type='html'>&lt;p style="font-family: arial;"&gt;&lt;span style="font-size:85%;"&gt;Creating variables in JavaScript is most often referred to as "declaring" variables.&lt;/span&gt;&lt;/p&gt; &lt;p style="font-family: arial;"&gt;&lt;span style="font-size:85%;"&gt;You can declare JavaScript variables with the &lt;b&gt;var statement&lt;/b&gt;:&lt;/span&gt;&lt;/p&gt;  &lt;table style="font-family: arial;" class="code" width="100%" border="0" cellpadding="0" cellspacing="0"&gt; &lt;tbody&gt;&lt;tr&gt;&lt;td&gt; &lt;span style="font-size:85%;"&gt;&lt;span style="font-weight: bold;"&gt;var x;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt; var carname;&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;  &lt;p style="font-family: arial;"&gt;&lt;span style="font-size:85%;"&gt;After the declaration shown above, the variables are empty (they have no values yet).&lt;/span&gt;&lt;/p&gt; &lt;p style="font-family: arial;"&gt;&lt;span style="font-size:85%;"&gt;However, you can also assign values to the variables when you declare them:&lt;/span&gt;&lt;/p&gt;  &lt;table style="font-family: arial;" class="code" width="100%" border="0" cellpadding="0" cellspacing="0"&gt; &lt;tbody&gt;&lt;tr&gt;&lt;td&gt; &lt;span style="font-size:85%;"&gt;&lt;span style="font-weight: bold;"&gt;var x=5;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt; var carname="Volvo";&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;  &lt;p style="font-family: arial;"&gt;&lt;span style="font-size:85%;"&gt;After the execution of the statements above, the variable &lt;b&gt;x&lt;/b&gt; will hold the value &lt;b&gt;5&lt;/b&gt;, and &lt;b&gt;carname&lt;/b&gt; will hold the value &lt;b&gt;Volvo&lt;/b&gt;.&lt;/span&gt;&lt;/p&gt; &lt;p style="font-family: arial;"&gt;&lt;span style="font-size:85%;"&gt;&lt;b&gt;Note:&lt;/b&gt; When you assign a text value to a variable, use quotes around the value.&lt;/span&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8707790305856929068-3477724227158202965?l=javascriptfactory.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javascriptfactory.blogspot.com/feeds/3477724227158202965/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://javascriptfactory.blogspot.com/2009/08/declaring-creating-javascript-variables.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8707790305856929068/posts/default/3477724227158202965'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8707790305856929068/posts/default/3477724227158202965'/><link rel='alternate' type='text/html' href='http://javascriptfactory.blogspot.com/2009/08/declaring-creating-javascript-variables.html' title='Declaring (Creating) JavaScript Variables'/><author><name>Vipin C</name><uri>http://www.blogger.com/profile/01967245433419006643</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8707790305856929068.post-6639371560933339715</id><published>2009-08-28T06:49:00.001-07:00</published><updated>2009-08-28T06:49:31.605-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Tutorials'/><title type='text'>JavaScript Variables</title><content type='html'>&lt;p style="font-family: arial;"&gt;&lt;span style="font-size:85%;"&gt;As with algebra, JavaScript variables are used to hold values or expressions.&lt;/span&gt;&lt;/p&gt; &lt;p style="font-family: arial;"&gt;&lt;span style="font-size:85%;"&gt;A variable can have a short name, like x, or a more descriptive name, like carname.&lt;/span&gt;&lt;/p&gt; &lt;p style="font-family: arial;"&gt;&lt;span style="font-size:85%;"&gt;Rules for JavaScript variable names:&lt;/span&gt;&lt;/p&gt; &lt;ul style="font-family: arial;"&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;Variable names are case sensitive (y and Y are two different variables)&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;Variable names must begin with a letter or the underscore character&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt; &lt;p style="font-family: arial;"&gt;&lt;span style="font-size:85%;"&gt;&lt;b&gt;Note:&lt;/b&gt; Because JavaScript is case-sensitive, variable names are case-sensitive.&lt;/span&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8707790305856929068-6639371560933339715?l=javascriptfactory.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javascriptfactory.blogspot.com/feeds/6639371560933339715/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://javascriptfactory.blogspot.com/2009/08/javascript-variables.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8707790305856929068/posts/default/6639371560933339715'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8707790305856929068/posts/default/6639371560933339715'/><link rel='alternate' type='text/html' href='http://javascriptfactory.blogspot.com/2009/08/javascript-variables.html' title='JavaScript Variables'/><author><name>Vipin C</name><uri>http://www.blogger.com/profile/01967245433419006643</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8707790305856929068.post-3197418391405589602</id><published>2009-08-28T06:48:00.000-07:00</published><updated>2009-08-28T06:49:02.427-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Tutorials'/><title type='text'>Do You Remember Algebra From School?</title><content type='html'>&lt;p style="font-family: arial;"&gt;&lt;span style="font-size:85%;"&gt;Do you remember algebra from school? x=5, y=6, z=x+y&lt;/span&gt;&lt;/p&gt; &lt;p style="font-family: arial;"&gt;&lt;span style="font-size:85%;"&gt;Do you remember that a letter (like x) could be used to hold a value (like 5), and that you could use the information above to calculate the value of z to be 11?&lt;/span&gt;&lt;/p&gt; &lt;p style="font-family: arial;"&gt;&lt;span style="font-size:85%;"&gt;These letters are called &lt;b&gt;variables&lt;/b&gt;, and variables can be used to hold values (x=5) or expressions (z=x+y).&lt;/span&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8707790305856929068-3197418391405589602?l=javascriptfactory.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javascriptfactory.blogspot.com/feeds/3197418391405589602/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://javascriptfactory.blogspot.com/2009/08/do-you-remember-algebra-from-school.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8707790305856929068/posts/default/3197418391405589602'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8707790305856929068/posts/default/3197418391405589602'/><link rel='alternate' type='text/html' href='http://javascriptfactory.blogspot.com/2009/08/do-you-remember-algebra-from-school.html' title='Do You Remember Algebra From School?'/><author><name>Vipin C</name><uri>http://www.blogger.com/profile/01967245433419006643</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8707790305856929068.post-9085922405641760730</id><published>2009-08-28T06:47:00.000-07:00</published><updated>2009-08-28T06:48:02.261-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Tutorials'/><title type='text'>Using Comments at the End of a Line</title><content type='html'>In&amp;#160;the&amp;#160;following&amp;#160;example&amp;#160;the&amp;#160;comment&amp;#160;is&amp;#160;placed&amp;#160;at&amp;#160;the&amp;#160;end&amp;#160;of&amp;#160;a&amp;#160;code&amp;#160;line:&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Example&lt;/span&gt;&lt;br /&gt;&amp;#60;script&amp;#160;type=&amp;#34;text/javascript&amp;#34;&amp;#62;&lt;br /&gt;document.write(&amp;#34;Hello&amp;#34;);&amp;#160;//&amp;#160;Write&amp;#160;&amp;#34;Hello&amp;#34;&lt;br /&gt;document.write(&amp;#34;&amp;#160;Dolly!&amp;#34;);&amp;#160;//&amp;#160;Write&amp;#160;&amp;#34;&amp;#160;Dolly!&amp;#34;&lt;br /&gt;&amp;#60;/script&amp;#62;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8707790305856929068-9085922405641760730?l=javascriptfactory.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javascriptfactory.blogspot.com/feeds/9085922405641760730/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://javascriptfactory.blogspot.com/2009/08/using-comments-at-end-of-line.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8707790305856929068/posts/default/9085922405641760730'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8707790305856929068/posts/default/9085922405641760730'/><link rel='alternate' type='text/html' href='http://javascriptfactory.blogspot.com/2009/08/using-comments-at-end-of-line.html' title='Using Comments at the End of a Line'/><author><name>Vipin C</name><uri>http://www.blogger.com/profile/01967245433419006643</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8707790305856929068.post-4379282611853925842</id><published>2009-08-28T06:45:00.000-07:00</published><updated>2009-08-28T06:46:42.890-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Tutorials'/><category scheme='http://www.blogger.com/atom/ns#' term='Examples'/><title type='text'>Using Comments to Prevent Execution</title><content type='html'>In&amp;#160;the&amp;#160;following&amp;#160;example&amp;#160;the&amp;#160;comment&amp;#160;is&amp;#160;used&amp;#160;to&amp;#160;prevent&amp;#160;the&amp;#160;execution&amp;#160;of&amp;#160;a&amp;#160;single&amp;#160;code&amp;#160;line&amp;#160;(can&amp;#160;be&amp;#160;suitable&amp;#160;for&amp;#160;debugging):&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Example&lt;/span&gt;&lt;br /&gt;&amp;#60;script&amp;#160;type=&amp;#34;text/javascript&amp;#34;&amp;#62;&lt;br /&gt;//document.write(&amp;#34;&amp;#60;h1&amp;#62;This&amp;#160;is&amp;#160;a&amp;#160;heading&amp;#60;/h1&amp;#62;&amp;#34;);&lt;br /&gt;document.write(&amp;#34;&amp;#60;p&amp;#62;This&amp;#160;is&amp;#160;a&amp;#160;paragraph.&amp;#60;/p&amp;#62;&amp;#34;);&lt;br /&gt;document.write(&amp;#34;&amp;#60;p&amp;#62;This&amp;#160;is&amp;#160;another&amp;#160;paragraph.&amp;#60;/p&amp;#62;&amp;#34;);&lt;br /&gt;&amp;#60;/script&amp;#62;&amp;#160;&lt;br /&gt;&lt;br /&gt;In&amp;#160;the&amp;#160;following&amp;#160;example&amp;#160;the&amp;#160;comment&amp;#160;is&amp;#160;used&amp;#160;to&amp;#160;prevent&amp;#160;the&amp;#160;execution&amp;#160;of&amp;#160;a&amp;#160;code&amp;#160;block&amp;#160;(can&amp;#160;be&amp;#160;suitable&amp;#160;for&amp;#160;debugging):&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Example&lt;/span&gt;&lt;br /&gt;&amp;#60;script&amp;#160;type=&amp;#34;text/javascript&amp;#34;&amp;#62;&lt;br /&gt;/*&lt;br /&gt;document.write(&amp;#34;&amp;#60;h1&amp;#62;This&amp;#160;is&amp;#160;a&amp;#160;heading&amp;#60;/h1&amp;#62;&amp;#34;);&lt;br /&gt;document.write(&amp;#34;&amp;#60;p&amp;#62;This&amp;#160;is&amp;#160;a&amp;#160;paragraph.&amp;#60;/p&amp;#62;&amp;#34;);&lt;br /&gt;document.write(&amp;#34;&amp;#60;p&amp;#62;This&amp;#160;is&amp;#160;another&amp;#160;paragraph.&amp;#60;/p&amp;#62;&amp;#34;);&lt;br /&gt;*/&lt;br /&gt;&amp;#60;/script&amp;#62;&amp;#160;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8707790305856929068-4379282611853925842?l=javascriptfactory.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javascriptfactory.blogspot.com/feeds/4379282611853925842/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://javascriptfactory.blogspot.com/2009/08/using-comments-to-prevent-execution.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8707790305856929068/posts/default/4379282611853925842'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8707790305856929068/posts/default/4379282611853925842'/><link rel='alternate' type='text/html' href='http://javascriptfactory.blogspot.com/2009/08/using-comments-to-prevent-execution.html' title='Using Comments to Prevent Execution'/><author><name>Vipin C</name><uri>http://www.blogger.com/profile/01967245433419006643</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8707790305856929068.post-5672617016531701347</id><published>2009-08-28T06:44:00.001-07:00</published><updated>2009-08-28T06:44:59.179-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Tutorials'/><category scheme='http://www.blogger.com/atom/ns#' term='Examples'/><title type='text'>JavaScript Multi-Line Comments</title><content type='html'>Multi&amp;#160;line&amp;#160;comments&amp;#160;start&amp;#160;with&amp;#160;/*&amp;#160;and&amp;#160;end&amp;#160;with&amp;#160;*/.&lt;br /&gt;&lt;br /&gt;The&amp;#160;following&amp;#160;example&amp;#160;uses&amp;#160;a&amp;#160;multi&amp;#160;line&amp;#160;comment&amp;#160;to&amp;#160;explain&amp;#160;the&amp;#160;code:&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Example&lt;/span&gt;&lt;br /&gt;&amp;#60;script&amp;#160;type=&amp;#34;text/javascript&amp;#34;&amp;#62;&lt;br /&gt;/*&lt;br /&gt;The&amp;#160;code&amp;#160;below&amp;#160;will&amp;#160;write&lt;br /&gt;one&amp;#160;heading&amp;#160;and&amp;#160;two&amp;#160;paragraphs&lt;br /&gt;*/&lt;br /&gt;document.write(&amp;#34;&amp;#60;h1&amp;#62;This&amp;#160;is&amp;#160;a&amp;#160;heading&amp;#60;/h1&amp;#62;&amp;#34;);&lt;br /&gt;document.write(&amp;#34;&amp;#60;p&amp;#62;This&amp;#160;is&amp;#160;a&amp;#160;paragraph.&amp;#60;/p&amp;#62;&amp;#34;);&lt;br /&gt;document.write(&amp;#34;&amp;#60;p&amp;#62;This&amp;#160;is&amp;#160;another&amp;#160;paragraph.&amp;#60;/p&amp;#62;&amp;#34;);&lt;br /&gt;&amp;#60;/script&amp;#62;&amp;#160;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8707790305856929068-5672617016531701347?l=javascriptfactory.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javascriptfactory.blogspot.com/feeds/5672617016531701347/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://javascriptfactory.blogspot.com/2009/08/javascript-multi-line-comments.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8707790305856929068/posts/default/5672617016531701347'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8707790305856929068/posts/default/5672617016531701347'/><link rel='alternate' type='text/html' href='http://javascriptfactory.blogspot.com/2009/08/javascript-multi-line-comments.html' title='JavaScript Multi-Line Comments'/><author><name>Vipin C</name><uri>http://www.blogger.com/profile/01967245433419006643</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8707790305856929068.post-1859596862683942031</id><published>2009-08-28T06:43:00.001-07:00</published><updated>2009-08-28T06:44:01.839-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Tutorials'/><title type='text'>JavaScript Comments</title><content type='html'>Comments&amp;#160;can&amp;#160;be&amp;#160;added&amp;#160;to&amp;#160;explain&amp;#160;the&amp;#160;JavaScript,&amp;#160;or&amp;#160;to&amp;#160;make&amp;#160;the&amp;#160;code&amp;#160;more&amp;#160;readable.&lt;br /&gt;&lt;br /&gt;Single&amp;#160;line&amp;#160;comments&amp;#160;start&amp;#160;with&amp;#160;//.&lt;br /&gt;&lt;br /&gt;The&amp;#160;following&amp;#160;example&amp;#160;uses&amp;#160;single&amp;#160;line&amp;#160;comments&amp;#160;to&amp;#160;explain&amp;#160;the&amp;#160;code:&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Example&lt;/span&gt;&lt;br /&gt;&amp;#60;script&amp;#160;type=&amp;#34;text/javascript&amp;#34;&amp;#62;&lt;br /&gt;//&amp;#160;Write&amp;#160;a&amp;#160;heading&lt;br /&gt;document.write(&amp;#34;&amp;#60;h1&amp;#62;This&amp;#160;is&amp;#160;a&amp;#160;heading&amp;#60;/h1&amp;#62;&amp;#34;);&lt;br /&gt;//&amp;#160;Write&amp;#160;two&amp;#160;paragraphs:&lt;br /&gt;document.write(&amp;#34;&amp;#60;p&amp;#62;This&amp;#160;is&amp;#160;a&amp;#160;paragraph.&amp;#60;/p&amp;#62;&amp;#34;);&lt;br /&gt;document.write(&amp;#34;&amp;#60;p&amp;#62;This&amp;#160;is&amp;#160;another&amp;#160;paragraph.&amp;#60;/p&amp;#62;&amp;#34;);&lt;br /&gt;&amp;#60;/script&amp;#62;&amp;#160;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8707790305856929068-1859596862683942031?l=javascriptfactory.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javascriptfactory.blogspot.com/feeds/1859596862683942031/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://javascriptfactory.blogspot.com/2009/08/javascript-comments.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8707790305856929068/posts/default/1859596862683942031'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8707790305856929068/posts/default/1859596862683942031'/><link rel='alternate' type='text/html' href='http://javascriptfactory.blogspot.com/2009/08/javascript-comments.html' title='JavaScript Comments'/><author><name>Vipin C</name><uri>http://www.blogger.com/profile/01967245433419006643</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8707790305856929068.post-3164217339033880289</id><published>2009-08-28T06:41:00.000-07:00</published><updated>2009-08-28T06:42:22.338-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Examples'/><title type='text'>JavaScript Blocks</title><content type='html'>JavaScript&amp;#160;statements&amp;#160;can&amp;#160;be&amp;#160;grouped&amp;#160;together&amp;#160;in&amp;#160;blocks.&lt;br /&gt;&lt;br /&gt;Blocks&amp;#160;start&amp;#160;with&amp;#160;a&amp;#160;left&amp;#160;curly&amp;#160;bracket&amp;#160;{,&amp;#160;and&amp;#160;ends&amp;#160;with&amp;#160;a&amp;#160;right&amp;#160;curly&amp;#160;bracket&amp;#160;}.&lt;br /&gt;&lt;br /&gt;The&amp;#160;purpose&amp;#160;of&amp;#160;a&amp;#160;block&amp;#160;is&amp;#160;to&amp;#160;make&amp;#160;the&amp;#160;sequence&amp;#160;of&amp;#160;statements&amp;#160;execute&amp;#160;together.&lt;br /&gt;&lt;br /&gt;This&amp;#160;example&amp;#160;will&amp;#160;write&amp;#160;a&amp;#160;heading&amp;#160;and&amp;#160;two&amp;#160;paragraphs&amp;#160;to&amp;#160;a&amp;#160;web&amp;#160;page:&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Example&lt;/span&gt;&lt;br /&gt;&amp;#60;script&amp;#160;type=&amp;#34;text/javascript&amp;#34;&amp;#62;&lt;br /&gt;{&lt;br /&gt;document.write(&amp;#34;&amp;#60;h1&amp;#62;This&amp;#160;is&amp;#160;a&amp;#160;heading&amp;#60;/h1&amp;#62;&amp;#34;);&lt;br /&gt;document.write(&amp;#34;&amp;#60;p&amp;#62;This&amp;#160;is&amp;#160;a&amp;#160;paragraph.&amp;#60;/p&amp;#62;&amp;#34;);&lt;br /&gt;document.write(&amp;#34;&amp;#60;p&amp;#62;This&amp;#160;is&amp;#160;another&amp;#160;paragraph.&amp;#60;/p&amp;#62;&amp;#34;);&lt;br /&gt;}&lt;br /&gt;&amp;#60;/script&amp;#62;&amp;#160;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8707790305856929068-3164217339033880289?l=javascriptfactory.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javascriptfactory.blogspot.com/feeds/3164217339033880289/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://javascriptfactory.blogspot.com/2009/08/javascript-blocks.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8707790305856929068/posts/default/3164217339033880289'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8707790305856929068/posts/default/3164217339033880289'/><link rel='alternate' type='text/html' href='http://javascriptfactory.blogspot.com/2009/08/javascript-blocks.html' title='JavaScript Blocks'/><author><name>Vipin C</name><uri>http://www.blogger.com/profile/01967245433419006643</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8707790305856929068.post-2256179921972247682</id><published>2009-08-28T06:40:00.000-07:00</published><updated>2009-08-28T06:41:20.192-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Examples'/><title type='text'>JavaScript Code</title><content type='html'>JavaScript&amp;#160;code&amp;#160;(or&amp;#160;just&amp;#160;JavaScript)&amp;#160;is&amp;#160;a&amp;#160;sequence&amp;#160;of&amp;#160;JavaScript&amp;#160;statements.&lt;br /&gt;&lt;br /&gt;Each&amp;#160;statement&amp;#160;is&amp;#160;executed&amp;#160;by&amp;#160;the&amp;#160;browser&amp;#160;in&amp;#160;the&amp;#160;sequence&amp;#160;they&amp;#160;are&amp;#160;written.&lt;br /&gt;&lt;br /&gt;This&amp;#160;example&amp;#160;will&amp;#160;write&amp;#160;a&amp;#160;heading&amp;#160;and&amp;#160;two&amp;#160;paragraphs&amp;#160;to&amp;#160;a&amp;#160;web&amp;#160;page:&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Example&lt;span style="font-weight:bold;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&amp;#60;script&amp;#160;type=&amp;#34;text/javascript&amp;#34;&amp;#62;&lt;br /&gt;document.write(&amp;#34;&amp;#60;h1&amp;#62;This&amp;#160;is&amp;#160;a&amp;#160;heading&amp;#60;/h1&amp;#62;&amp;#34;);&lt;br /&gt;document.write(&amp;#34;&amp;#60;p&amp;#62;This&amp;#160;is&amp;#160;a&amp;#160;paragraph.&amp;#60;/p&amp;#62;&amp;#34;);&lt;br /&gt;document.write(&amp;#34;&amp;#60;p&amp;#62;This&amp;#160;is&amp;#160;another&amp;#160;paragraph.&amp;#60;/p&amp;#62;&amp;#34;);&lt;br /&gt;&amp;#60;/script&amp;#62;&amp;#160;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8707790305856929068-2256179921972247682?l=javascriptfactory.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javascriptfactory.blogspot.com/feeds/2256179921972247682/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://javascriptfactory.blogspot.com/2009/08/javascript-code.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8707790305856929068/posts/default/2256179921972247682'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8707790305856929068/posts/default/2256179921972247682'/><link rel='alternate' type='text/html' href='http://javascriptfactory.blogspot.com/2009/08/javascript-code.html' title='JavaScript Code'/><author><name>Vipin C</name><uri>http://www.blogger.com/profile/01967245433419006643</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8707790305856929068.post-3650880071712675480</id><published>2009-08-28T06:39:00.000-07:00</published><updated>2009-08-28T06:40:17.900-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Tutorials'/><title type='text'>JavaScript Statements</title><content type='html'>&lt;p style="font-family: arial;"&gt;&lt;span style="font-size:85%;"&gt;A JavaScript statement is a command to a browser. The purpose of the command is to tell the browser what to do.&lt;/span&gt;&lt;/p&gt; &lt;p style="font-family: arial;"&gt;&lt;span style="font-size:85%;"&gt;This JavaScript statement tells the browser to write "Hello Dolly" to the web page:&lt;/span&gt;&lt;/p&gt;  &lt;table style="font-family: arial; font-weight: bold;" class="code" width="100%" border="0" cellpadding="0" cellspacing="0"&gt; &lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;span style="font-size:85%;"&gt;document.write("Hello Dolly");&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;  &lt;p style="font-family: arial;"&gt;&lt;span style="font-size:85%;"&gt;It is normal to add a semicolon at the end of each executable statement. Most people think this is a good programming practice, and most often you will see this in JavaScript examples on the web.&lt;/span&gt;&lt;/p&gt; &lt;p style="font-family: arial;"&gt;&lt;span style="font-size:85%;"&gt;The semicolon is optional (according to the JavaScript standard), and the browser is supposed to interpret the end of the line as the end of the statement. Because of this you will often see examples without the semicolon at the end.&lt;/span&gt;&lt;/p&gt; &lt;p style="font-family: arial;"&gt;&lt;span style="font-size:85%;"&gt;&lt;b&gt;Note:&lt;/b&gt; Using semicolons makes it possible to write multiple statements on one line. &lt;/span&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8707790305856929068-3650880071712675480?l=javascriptfactory.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javascriptfactory.blogspot.com/feeds/3650880071712675480/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://javascriptfactory.blogspot.com/2009/08/javascript-statements.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8707790305856929068/posts/default/3650880071712675480'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8707790305856929068/posts/default/3650880071712675480'/><link rel='alternate' type='text/html' href='http://javascriptfactory.blogspot.com/2009/08/javascript-statements.html' title='JavaScript Statements'/><author><name>Vipin C</name><uri>http://www.blogger.com/profile/01967245433419006643</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8707790305856929068.post-4351152380893630492</id><published>2009-08-28T06:38:00.000-07:00</published><updated>2009-08-28T06:39:20.147-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Tutorials'/><title type='text'>JavaScript is Case Sensitive</title><content type='html'>&lt;span style="font-size:85%;"&gt;&lt;span style="font-family: arial;"&gt;Unlike HTML, JavaScript is case sensitive - therefore watch your capitalization closely when you write JavaScript statements, create or call variables, objects and functions.&lt;/span&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8707790305856929068-4351152380893630492?l=javascriptfactory.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javascriptfactory.blogspot.com/feeds/4351152380893630492/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://javascriptfactory.blogspot.com/2009/08/javascript-is-case-sensitive.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8707790305856929068/posts/default/4351152380893630492'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8707790305856929068/posts/default/4351152380893630492'/><link rel='alternate' type='text/html' href='http://javascriptfactory.blogspot.com/2009/08/javascript-is-case-sensitive.html' title='JavaScript is Case Sensitive'/><author><name>Vipin C</name><uri>http://www.blogger.com/profile/01967245433419006643</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8707790305856929068.post-6571366374620809371</id><published>2009-08-28T06:24:00.000-07:00</published><updated>2009-08-28T06:37:09.268-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Tutorials'/><title type='text'>Where to Put the JavaScript</title><content type='html'>JavaScripts&amp;#160;in&amp;#160;a&amp;#160;page&amp;#160;will&amp;#160;be&amp;#160;executed&amp;#160;immediately&amp;#160;while&amp;#160;the&amp;#160;page&amp;#160;loads&amp;#160;into&amp;#160;the&amp;#160;browser.&amp;#160;This&amp;#160;is&amp;#160;not&amp;#160;always&amp;#160;what&amp;#160;we&amp;#160;want.&amp;#160;Sometimes&amp;#160;we&amp;#160;want&amp;#160;to&amp;#160;execute&amp;#160;a&amp;#160;script&amp;#160;when&amp;#160;a&amp;#160;page&amp;#160;loads,&amp;#160;other&amp;#160;times&amp;#160;when&amp;#160;a&amp;#160;user&amp;#160;triggers&amp;#160;an&amp;#160;event.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Scripts&amp;#160;in&amp;#160;&amp;#60;head&amp;#62;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;Scripts&amp;#160;to&amp;#160;be&amp;#160;executed&amp;#160;when&amp;#160;they&amp;#160;are&amp;#160;called,&amp;#160;or&amp;#160;when&amp;#160;an&amp;#160;event&amp;#160;is&amp;#160;triggered,&amp;#160;go&amp;#160;in&amp;#160;the&amp;#160;head&amp;#160;section.&lt;br /&gt;&lt;br /&gt;If&amp;#160;you&amp;#160;place&amp;#160;a&amp;#160;script&amp;#160;in&amp;#160;the&amp;#160;head&amp;#160;section,&amp;#160;you&amp;#160;will&amp;#160;ensure&amp;#160;that&amp;#160;the&amp;#160;script&amp;#160;is&amp;#160;loaded&amp;#160;before&amp;#160;anyone&amp;#160;uses&amp;#160;it.&lt;br /&gt;Example&lt;br /&gt;&amp;#60;html&amp;#62;&lt;br /&gt;&amp;#60;head&amp;#62;&lt;br /&gt;&amp;#60;script&amp;#160;type=&amp;#34;text/javascript&amp;#34;&amp;#62;&lt;br /&gt;function&amp;#160;message()&lt;br /&gt;{&lt;br /&gt;alert(&amp;#34;This&amp;#160;alert&amp;#160;box&amp;#160;was&amp;#160;called&amp;#160;with&amp;#160;the&amp;#160;onload&amp;#160;event&amp;#34;);&lt;br /&gt;}&lt;br /&gt;&amp;#60;/script&amp;#62;&lt;br /&gt;&amp;#60;/head&amp;#62;&lt;br /&gt;&lt;br /&gt;&amp;#60;body&amp;#160;onload=&amp;#34;message()&amp;#34;&amp;#62;&lt;br /&gt;&amp;#60;/body&amp;#62;&lt;br /&gt;&amp;#60;/html&amp;#62;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Scripts&amp;#160;in&amp;#160;&amp;#60;body&amp;#62;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;Scripts&amp;#160;to&amp;#160;be&amp;#160;executed&amp;#160;when&amp;#160;the&amp;#160;page&amp;#160;loads&amp;#160;go&amp;#160;in&amp;#160;the&amp;#160;body&amp;#160;section.&lt;br /&gt;&lt;br /&gt;If&amp;#160;you&amp;#160;place&amp;#160;a&amp;#160;script&amp;#160;in&amp;#160;the&amp;#160;body&amp;#160;section,&amp;#160;it&amp;#160;generates&amp;#160;the&amp;#160;content&amp;#160;of&amp;#160;a&amp;#160;page.&lt;br /&gt;Example&lt;br /&gt;&amp;#60;html&amp;#62;&lt;br /&gt;&amp;#60;head&amp;#62;&lt;br /&gt;&amp;#60;/head&amp;#62;&lt;br /&gt;&lt;br /&gt;&amp;#60;body&amp;#62;&lt;br /&gt;&amp;#60;script&amp;#160;type=&amp;#34;text/javascript&amp;#34;&amp;#62;&lt;br /&gt;document.write(&amp;#34;This&amp;#160;message&amp;#160;is&amp;#160;written&amp;#160;by&amp;#160;JavaScript&amp;#34;);&lt;br /&gt;&amp;#60;/script&amp;#62;&lt;br /&gt;&amp;#60;/body&amp;#62;&lt;br /&gt;&lt;br /&gt;&amp;#60;/html&amp;#62;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Scripts&amp;#160;in&amp;#160;&amp;#60;head&amp;#62;&amp;#160;and&amp;#160;&amp;#60;body&amp;#62;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;You&amp;#160;can&amp;#160;place&amp;#160;an&amp;#160;unlimited&amp;#160;number&amp;#160;of&amp;#160;scripts&amp;#160;in&amp;#160;your&amp;#160;document,&amp;#160;so&amp;#160;you&amp;#160;can&amp;#160;have&amp;#160;scripts&amp;#160;in&amp;#160;both&amp;#160;the&amp;#160;body&amp;#160;and&amp;#160;the&amp;#160;head&amp;#160;section.&lt;br /&gt;&amp;#60;html&amp;#62;&lt;br /&gt;&amp;#60;head&amp;#62;&lt;br /&gt;&amp;#60;script&amp;#160;type=&amp;#34;text/javascript&amp;#34;&amp;#62;&lt;br /&gt;....&lt;br /&gt;&amp;#60;/script&amp;#62;&lt;br /&gt;&amp;#60;/head&amp;#62;&lt;br /&gt;&amp;#60;body&amp;#62;&lt;br /&gt;&amp;#60;script&amp;#160;type=&amp;#34;text/javascript&amp;#34;&amp;#62;&lt;br /&gt;....&lt;br /&gt;&amp;#60;/script&amp;#62;&lt;br /&gt;&amp;#60;/body&amp;#62;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Using&amp;#160;an&amp;#160;External&amp;#160;JavaScript&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;If&amp;#160;you&amp;#160;want&amp;#160;to&amp;#160;run&amp;#160;the&amp;#160;same&amp;#160;JavaScript&amp;#160;on&amp;#160;several&amp;#160;pages,&amp;#160;without&amp;#160;having&amp;#160;to&amp;#160;write&amp;#160;the&amp;#160;same&amp;#160;script&amp;#160;on&amp;#160;every&amp;#160;page,&amp;#160;you&amp;#160;can&amp;#160;write&amp;#160;a&amp;#160;JavaScript&amp;#160;in&amp;#160;an&amp;#160;external&amp;#160;file.&lt;br /&gt;&lt;br /&gt;Save&amp;#160;the&amp;#160;external&amp;#160;JavaScript&amp;#160;file&amp;#160;with&amp;#160;a&amp;#160;.js&amp;#160;file&amp;#160;extension.&lt;br /&gt;&lt;br /&gt;Note:&amp;#160;The&amp;#160;external&amp;#160;script&amp;#160;cannot&amp;#160;contain&amp;#160;the&amp;#160;&amp;#60;script&amp;#62;&amp;#160;tag!&lt;br /&gt;&lt;br /&gt;To&amp;#160;use&amp;#160;the&amp;#160;external&amp;#160;script,&amp;#160;point&amp;#160;to&amp;#160;the&amp;#160;.js&amp;#160;file&amp;#160;in&amp;#160;the&amp;#160;&amp;#34;src&amp;#34;&amp;#160;attribute&amp;#160;of&amp;#160;the&amp;#160;&amp;#60;script&amp;#62;&amp;#160;tag:&lt;br /&gt;Example&lt;br /&gt;&amp;#60;html&amp;#62;&lt;br /&gt;&amp;#60;head&amp;#62;&lt;br /&gt;&amp;#60;script&amp;#160;type=&amp;#34;text/javascript&amp;#34;&amp;#160;src=&amp;#34;xxx.js&amp;#34;&amp;#62;&amp;#60;/script&amp;#62;&lt;br /&gt;&amp;#60;/head&amp;#62;&lt;br /&gt;&amp;#60;body&amp;#62;&lt;br /&gt;&amp;#60;/body&amp;#62;&lt;br /&gt;&amp;#60;/html&amp;#62;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8707790305856929068-6571366374620809371?l=javascriptfactory.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javascriptfactory.blogspot.com/feeds/6571366374620809371/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://javascriptfactory.blogspot.com/2009/08/where-to-put-javascript.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8707790305856929068/posts/default/6571366374620809371'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8707790305856929068/posts/default/6571366374620809371'/><link rel='alternate' type='text/html' href='http://javascriptfactory.blogspot.com/2009/08/where-to-put-javascript.html' title='Where to Put the JavaScript'/><author><name>Vipin C</name><uri>http://www.blogger.com/profile/01967245433419006643</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8707790305856929068.post-1063819184235477020</id><published>2009-08-28T04:31:00.000-07:00</published><updated>2009-08-28T05:13:15.144-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Examples'/><title type='text'>Put a JavaScript into an HTML page</title><content type='html'>&lt;p style="font-family: arial;"&gt;&lt;span style="font-size:85%;"&gt;The example below shows how to use JavaSript to write text on a web page:&lt;/span&gt;&lt;/p&gt;   &lt;h2 style="font-family: arial;" class="example"&gt;&lt;span style="font-size:85%;"&gt;Example&lt;/span&gt;&lt;/h2&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&amp;#60;html&amp;#62;&lt;br /&gt;&amp;#60;body&amp;#62;&lt;br /&gt;&amp;#60;script&amp;#160;type=&amp;#34;&amp;#160;text/javascript&amp;#34;&amp;#62;&lt;br /&gt;document.write(&amp;#34;&amp;#160;Hello&amp;#160;World!&amp;#34;);&lt;br /&gt;&amp;#60;/script&amp;#62;&lt;br /&gt;&amp;#60;/body&amp;#62;&lt;br /&gt;&amp;#60;/html&amp;#62;&amp;#160;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;p style="font-family: arial;"&gt;&lt;span style="font-size:85%;"&gt;The example below shows how to add HTML tags to the JavaScript:&lt;/span&gt;&lt;/p&gt;   &lt;h2 style="font-family: arial;" class="example"&gt;&lt;span style="font-size:85%;"&gt;Example&lt;/span&gt;&lt;/h2&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&amp;#60;html&amp;#62;&lt;br /&gt;&amp;#60;body&amp;#62;&lt;br /&gt;&amp;#60;script&amp;#160;type=&amp;#34;text/javascript&amp;#34;&amp;#62;&lt;br /&gt;document.write(&amp;#34;&amp;#60;h1&amp;#62;Hello&amp;#160;World!&amp;#60;/h1&amp;#62;&amp;#34;);&lt;br /&gt;&amp;#60;/script&amp;#62;&lt;br /&gt;&amp;#60;/body&amp;#62;&lt;br /&gt;&amp;#60;/html&amp;#62;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;To&amp;#160;insert&amp;#160;a&amp;#160;JavaScript&amp;#160;into&amp;#160;an&amp;#160;HTML&amp;#160;page,&amp;#160;we&amp;#160;use&amp;#160;the&amp;#160;&amp;#60;script&amp;#62;&amp;#160;tag.&amp;#160;Inside&amp;#160;the&amp;#160;&amp;#60;script&amp;#62;&amp;#160;tag&amp;#160;we&amp;#160;use&amp;#160;the&amp;#160;type&amp;#160;attribute&amp;#160;to&amp;#160;define&amp;#160;the&amp;#160;scripting&amp;#160;language.&lt;br /&gt;&lt;br /&gt;So,&amp;#160;the&amp;#160;&amp;#60;script&amp;#160;type=&amp;#34;text/javascript&amp;#34;&amp;#62;&amp;#160;and&amp;#160;&amp;#60;/script&amp;#62;&amp;#160;tells&amp;#160;where&amp;#160;the&amp;#160;JavaScript&amp;#160;starts&amp;#160;and&amp;#160;ends:&lt;br /&gt;&amp;#60;html&amp;#62;&lt;br /&gt;&amp;#60;body&amp;#62;&lt;br /&gt;&amp;#60;script&amp;#160;type=&amp;#34;text/javascript&amp;#34;&amp;#62;&lt;br /&gt;...&lt;br /&gt;&amp;#60;/script&amp;#62;&lt;br /&gt;&amp;#60;/body&amp;#62;&lt;br /&gt;&amp;#60;/html&amp;#62;&lt;br /&gt;&lt;br /&gt;The&amp;#160;document.write&amp;#160;command&amp;#160;is&amp;#160;a&amp;#160;standard&amp;#160;JavaScript&amp;#160;command&amp;#160;for&amp;#160;writing&amp;#160;output&amp;#160;to&amp;#160;a&amp;#160;page.&lt;br /&gt;&lt;br /&gt;By&amp;#160;entering&amp;#160;the&amp;#160;document.write&amp;#160;command&amp;#160;between&amp;#160;the&amp;#160;&amp;#60;script&amp;#62;&amp;#160;and&amp;#160;&amp;#60;/script&amp;#62;&amp;#160;tags,&amp;#160;the&amp;#160;browser&amp;#160;will&amp;#160;recognize&amp;#160;it&amp;#160;as&amp;#160;a&amp;#160;JavaScript&amp;#160;command&amp;#160;and&amp;#160;execute&amp;#160;the&amp;#160;code&amp;#160;line.&amp;#160;In&amp;#160;this&amp;#160;case&amp;#160;the&amp;#160;browser&amp;#160;will&amp;#160;write&amp;#160;Hello&amp;#160;World!&amp;#160;to&amp;#160;the&amp;#160;page:&lt;br /&gt;&amp;#60;html&amp;#62;&lt;br /&gt;&amp;#60;body&amp;#62;&lt;br /&gt;&amp;#60;script&amp;#160;type=&amp;#34;text/javascript&amp;#34;&amp;#62;&lt;br /&gt;document.write(&amp;#34;Hello&amp;#160;World!&amp;#34;);&lt;br /&gt;&amp;#60;/script&amp;#62;&lt;br /&gt;&amp;#60;/body&amp;#62;&lt;br /&gt;&amp;#60;/html&amp;#62;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8707790305856929068-1063819184235477020?l=javascriptfactory.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javascriptfactory.blogspot.com/feeds/1063819184235477020/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://javascriptfactory.blogspot.com/2009/08/put-javascript-into-html-page_28.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8707790305856929068/posts/default/1063819184235477020'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8707790305856929068/posts/default/1063819184235477020'/><link rel='alternate' type='text/html' href='http://javascriptfactory.blogspot.com/2009/08/put-javascript-into-html-page_28.html' title='Put a JavaScript into an HTML page'/><author><name>Vipin C</name><uri>http://www.blogger.com/profile/01967245433419006643</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8707790305856929068.post-8305802377960723098</id><published>2009-08-26T23:19:00.000-07:00</published><updated>2009-08-26T23:20:01.153-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Tutorials'/><title type='text'>The Real Name is ECMAScript</title><content type='html'>&lt;p style="font-family: arial;"&gt;&lt;span style="font-size:85%;"&gt;JavaScript's official name is ECMAScript.&lt;/span&gt;&lt;/p&gt; &lt;p style="font-family: arial;"&gt;&lt;span style="font-size:85%;"&gt;ECMAScript is  developed and maintained by the &lt;a target="_blank" href="http://www.ecma-international.org/"&gt;ECMA organization&lt;/a&gt;.  &lt;/span&gt;&lt;/p&gt; &lt;p style="font-family: arial;"&gt;&lt;span style="font-size:85%;"&gt;ECMA-262 is the official JavaScript standard.&lt;/span&gt;&lt;/p&gt; &lt;p style="font-family: arial;"&gt;&lt;span style="font-size:85%;"&gt;The language was invented by Brendan  Eich at Netscape (with Navigator 2.0), and has appeared in all Netscape and Microsoft  browsers since 1996.&lt;/span&gt;&lt;/p&gt; &lt;p style="font-family: arial;"&gt;&lt;span style="font-size:85%;"&gt;The development of ECMA-262 started in 1996, and the  first edition of was adopted by the ECMA General Assembly in June 1997.&lt;/span&gt;&lt;/p&gt; &lt;p style="font-family: arial;"&gt;&lt;span style="font-size:85%;"&gt;The standard was approved as an international ISO (ISO/IEC  16262) standard in 1998.&lt;/span&gt;&lt;/p&gt; &lt;p style="font-family: arial;"&gt;&lt;span style="font-size:85%;"&gt;The development of the standard is still in progress.&lt;/span&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8707790305856929068-8305802377960723098?l=javascriptfactory.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javascriptfactory.blogspot.com/feeds/8305802377960723098/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://javascriptfactory.blogspot.com/2009/08/real-name-is-ecmascript.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8707790305856929068/posts/default/8305802377960723098'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8707790305856929068/posts/default/8305802377960723098'/><link rel='alternate' type='text/html' href='http://javascriptfactory.blogspot.com/2009/08/real-name-is-ecmascript.html' title='The Real Name is ECMAScript'/><author><name>Vipin C</name><uri>http://www.blogger.com/profile/01967245433419006643</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8707790305856929068.post-7394457548370419864</id><published>2009-08-26T23:17:00.000-07:00</published><updated>2009-08-26T23:19:10.919-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Tutorials'/><title type='text'>What can a JavaScript do?</title><content type='html'>&lt;ul style="font-family: arial;"&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;&lt;b&gt;JavaScript gives HTML designers a programming tool - &lt;/b&gt;HTML authors are normally not programmers, but JavaScript is a scripting language with a    very simple syntax! Almost anyone can put small "snippets" of code into their HTML pages&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;&lt;b&gt;JavaScript can put dynamic text into an HTML page - &lt;/b&gt;A JavaScript statement like this: document.write("&lt;h1&gt;" + name + "&lt;/h1&gt;") can write a variable text into an HTML page&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;&lt;b&gt;JavaScript can react to events - &lt;/b&gt;A JavaScript can be set to execute when something happens, like when a page has finished loading or when a user    clicks on an HTML element&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;&lt;b&gt;JavaScript can read and write HTML elements - &lt;/b&gt;A JavaScript can read and change the content of an HTML element&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;&lt;b&gt;JavaScript can be used to validate data - &lt;/b&gt;A JavaScript can be used to validate form data before it is submitted to a server. This saves the    server from extra processing&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;&lt;b&gt;JavaScript can be used to detect the visitor's browser&lt;/b&gt; - A JavaScript can be used to detect the visitor's browser, and - depending on   the browser - load another page specifically designed for that browser&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;&lt;b&gt;JavaScript can be used to create cookies&lt;/b&gt; - A JavaScript can be used to store and retrieve information on the visitor's computer&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8707790305856929068-7394457548370419864?l=javascriptfactory.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javascriptfactory.blogspot.com/feeds/7394457548370419864/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://javascriptfactory.blogspot.com/2009/08/what-can-javascript-do.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8707790305856929068/posts/default/7394457548370419864'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8707790305856929068/posts/default/7394457548370419864'/><link rel='alternate' type='text/html' href='http://javascriptfactory.blogspot.com/2009/08/what-can-javascript-do.html' title='What can a JavaScript do?'/><author><name>Vipin C</name><uri>http://www.blogger.com/profile/01967245433419006643</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8707790305856929068.post-27389550545139089</id><published>2009-08-26T23:16:00.000-07:00</published><updated>2009-08-26T23:17:47.171-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Tutorials'/><title type='text'>Are Java and JavaScript the same?</title><content type='html'>&lt;p style="font-family: arial;"&gt;&lt;span style="font-size:85%;"&gt;NO!&lt;/span&gt;&lt;/p&gt; &lt;p style="font-family: arial;"&gt;&lt;span style="font-size:85%;"&gt;Java and JavaScript are two completely different languages in both concept and design!&lt;/span&gt;&lt;/p&gt; &lt;p style="font-family: arial;"&gt;&lt;span style="font-size:85%;"&gt;Java (developed by Sun Microsystems) is a powerful and much more complex programming language - in the same category as C and C++.&lt;/span&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8707790305856929068-27389550545139089?l=javascriptfactory.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javascriptfactory.blogspot.com/feeds/27389550545139089/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://javascriptfactory.blogspot.com/2009/08/are-java-and-javascript-same.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8707790305856929068/posts/default/27389550545139089'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8707790305856929068/posts/default/27389550545139089'/><link rel='alternate' type='text/html' href='http://javascriptfactory.blogspot.com/2009/08/are-java-and-javascript-same.html' title='Are Java and JavaScript the same?'/><author><name>Vipin C</name><uri>http://www.blogger.com/profile/01967245433419006643</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8707790305856929068.post-215519937218764852</id><published>2009-08-26T04:56:00.000-07:00</published><updated>2009-08-26T05:01:32.166-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Questions and Answers'/><title type='text'>Few doubts that you could have !!!</title><content type='html'>&lt;div style="font-family: arial;font-family:arial;"  class="pDsc"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-weight: bold;" class="pCo"&gt;What exactly is Javascript?: &lt;/span&gt;&lt;br /&gt;Javascript is a programming language that is used to make web pages interactive. It runs on your visitor's computer and so does not require constant downloads from your web site.&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: arial;font-family:arial;"  class="pDsc"&gt;&lt;span style="font-size:85%;"&gt;&lt;span class="pCo"&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Are Javascript and Java the same?: &lt;/span&gt;&lt;br /&gt;&lt;/span&gt;No, they are two completely different computer languages. Only their names are similar.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: arial;font-family:arial;"  class="pDsc"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-weight: bold;" class="pCo"&gt;What do I need to run Javascript?: &lt;/span&gt;&lt;br /&gt;Javascript support is built right into web browsers. Provided that the visitors to your site are using web browsers that support Javascript (most do) and have Javascript enabled (it is by default) then your Javascript will run.&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: arial;font-family:arial;"  class="pDsc"&gt;&lt;span style="font-size:85%;"&gt;&lt;span class="pCo"&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Do I need to learn Javascript to be able to use it?: &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;No. There are plenty of Javascripts that have already been written that people have made available for you to plug straight into your web page. All you need to know to be able to use such scripts is how to &lt;a href="http://javascript.about.com/library/blcopy.htm"&gt;paste&lt;/a&gt; the supplied code into the required places in your web page.&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: arial;font-family:arial;"  class="pDsc"&gt;&lt;span style="font-size:85%;"&gt;&lt;span class="pCo"&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;What do I need to write Javascript?: &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;Javascript is an interpreted language and so no special program is required to be able to create usable code. Any plain text editor such as Notepad is quite satisfactory for being able to write Javascript. That said, an editor which colourizes the code to make it easier to see what is what makes it easier to find your mistakes but then my &lt;a href="http://javascript.about.com/library/blformat.htm"&gt;Javascript Formatter&lt;/a&gt; can reformat your script to make errors even easier to spot.&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: arial;font-family:arial;"  class="pDsc"&gt;&lt;span style="font-size:85%;"&gt;&lt;span class="pCo"&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Can I use HTML instead of Javascript?: &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;No. HTML and Javascript are two completely different things. HTML is a markup language designed for defining static web page content. Javascript is a programming language designed for performing dynamic tasks.&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: arial;font-family:arial;"  class="pDsc"&gt;&lt;span style="font-size:85%;"&gt;&lt;span class="pCo"&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Can I use PHP or some other server side language instead of Javascript?: &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;Perhaps, it depends on where the code needs to run. If it can run before the page loads you can use a server side language. If it has to run after the page has loaded then you must use Javascript as this is the only scripting language supported by all web browsers that support client side scripting.&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: arial;font-family:arial;"  class="pDsc"&gt;&lt;span style="font-size:85%;"&gt;&lt;span class="pCo"&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Does the Javascript go in the same file as the HTML?: &lt;/span&gt;&lt;br /&gt;&lt;/span&gt;It can but your scripts will be more easily reused on multiple pages of your site if you place them in separate files (using a .js extension helps identify them as Javascript). You then just link the Javascript to your HTML by inserting a &lt;script&gt; tag. The same Javascript can then be added to several pages just by adding the appropriate tag into each of the pages to set up the link.&lt;/span&gt;&lt;/div&gt;&lt;/script&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8707790305856929068-215519937218764852?l=javascriptfactory.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javascriptfactory.blogspot.com/feeds/215519937218764852/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://javascriptfactory.blogspot.com/2009/08/few-doubts-that-you-could-have.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8707790305856929068/posts/default/215519937218764852'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8707790305856929068/posts/default/215519937218764852'/><link rel='alternate' type='text/html' href='http://javascriptfactory.blogspot.com/2009/08/few-doubts-that-you-could-have.html' title='Few doubts that you could have !!!'/><author><name>Vipin C</name><uri>http://www.blogger.com/profile/01967245433419006643</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8707790305856929068.post-1245507442609649217</id><published>2009-08-26T04:53:00.000-07:00</published><updated>2009-08-26T04:54:27.889-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Tutorials'/><title type='text'>More than you might want to know !</title><content type='html'>&lt;div style="font-family: arial;"&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;JavaScript is a scripting language, ideal for small programs used only from within Web browsers. A JavaScript script can't run alone, without the browser, the way a Java program does. &lt;/span&gt;&lt;p&gt;&lt;span style="font-size:85%;"&gt;JScript is Microsoft's implementation of JavaScript. &lt;/span&gt;&lt;/p&gt;&lt;/li&gt; &lt;p&gt;&lt;span style="font-size:85%;"&gt;&lt;b&gt;A Little History...&lt;/b&gt;&lt;br /&gt;In typical Web fashion, the evolutionary process of JavaScript has taken a somewhat lumpy path. When JavaScript started out life at Netscape, it was called LiveScript and its goal was to allow dynamic ("live") changes of Web pages and communication between the Web browser and plug-in applications ... such as Java. Java was hot and marketable, so in late 1995 Netscape got permission from Sun, the creators of Java, to use the word "Java" and Livescript became the *catchier* JavaScript. &lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size:85%;"&gt;But along the way, JavaScript took on a life of its own. It was easier for non-programmers to learn than Java. It could add a lot of interactivity with little overhead. Like HTML code, JavaScript is contained within the HTML text file, so it can be easily added and modified. It became hot itself. And so now there's a move afoot to standardize JavaScript. &lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size:85%;"&gt;&lt;b&gt;More Than You Might Want to Know, But...&lt;/b&gt;&lt;br /&gt;Within the Web environment, the most common use of Java is to build applets, small programs that launch automatically from within a Web page. When the Web page loads, these applets are launched and begin to run on your local computer. While the applet runs, your browser sits quietly by. &lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size:85%;"&gt;On the plus side, running a Java applet doesn't consume server time. It makes it possible for small, self-contained programs to be delivered via the Web, but run locally on individual computers. However, downloading Java applets has some people concerned about security; in corporate environments, Information Systems departments sometimes set up procedures to screen out external Java applets and prevent them from being downloaded. These IS managers fear (rightly or wrongly) that the applet could infect the system or be, in some way, a threat to the network. &lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size:85%;"&gt;JavaScript, on the other hand, is attractive to Web developers because it is a scripting language rather than a self-executing program. The code is typically placed directly in the Web page—in fact, it requires a Web browser in order to run and it is designed to be fully-integrated with the browser. Because the JavaScript is physically located within the Web page, firewalls can't screen it out (although individual browsers can be configured to turn off JavaScript). &lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8707790305856929068-1245507442609649217?l=javascriptfactory.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javascriptfactory.blogspot.com/feeds/1245507442609649217/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://javascriptfactory.blogspot.com/2009/08/more-than-you-might-want-to-know.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8707790305856929068/posts/default/1245507442609649217'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8707790305856929068/posts/default/1245507442609649217'/><link rel='alternate' type='text/html' href='http://javascriptfactory.blogspot.com/2009/08/more-than-you-might-want-to-know.html' title='More than you might want to know !'/><author><name>Vipin C</name><uri>http://www.blogger.com/profile/01967245433419006643</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8707790305856929068.post-6936907088540762254</id><published>2009-08-26T04:48:00.000-07:00</published><updated>2009-08-26T23:16:21.632-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Tutorials'/><title type='text'>What is Javascript ?</title><content type='html'>&lt;blockquote style="font-family: arial;font-family:arial;" &gt;&lt;span style="font-size:85%;"&gt;JavaScript is an object-oriented scripting language that lets you build interactions between page content, the state of the browser, and the actions of the reader. &lt;/span&gt;&lt;/blockquote&gt; &lt;p style="font-family: arial;font-family:arial;" &gt;&lt;span style="font-size:85%;"&gt;In other words, JavaScript is a language that lets you make your pages interact with your readers and respond to what they do.  &lt;/span&gt;&lt;/p&gt;&lt;p style="font-family: arial;font-family:arial;" &gt;&lt;span style="font-size:85%;"&gt;It is a programming language that can make your pages feel more dynamic and give feedback to your user. This is a good argument for learning and incorporating it into your web techniques basket. &lt;/span&gt;&lt;/p&gt;&lt;p style="font-family: arial;font-family:arial;" &gt;&lt;span style="font-size:85%;"&gt;It is a programming language that also has a learning curve in order for you to use it well. But don't let this scare you away from it—if you aren't a programmer, you can start out by learning a few basic concepts and then adapt existing JavaScript scripts for your needs. &lt;/span&gt;&lt;/p&gt;&lt;p style="font-family: arial;font-family:arial;" &gt;&lt;span style="font-size:85%;"&gt;If you don't want to tackle JavaScript, that's OK too. You can still make attractive pages that your readers will like, using standard HTML. Don't let the "flavor of the month" mentality convince you that only programmers or big budget outfits can have a Web page. But take a look through this section—you might surprise yourself by knowing more about scripting than you think.&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;h2 style="font-family: arial;"&gt;&lt;span style="font-size:85%;"&gt;What is JavaScript?&lt;/span&gt;&lt;/h2&gt; &lt;ul style="font-family: arial;"&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;JavaScript was designed to add interactivity to HTML pages&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;JavaScript is a scripting language&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;A scripting language is a lightweight programming language&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;JavaScript is usually embedded directly into HTML pages&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;JavaScript is an interpreted language (means that scripts execute without preliminary compilation)&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;Everyone can use JavaScript without purchasing a license&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;h2 style="font-family: arial;"&gt;&lt;span style="font-size:85%;"&gt;What You Should Already Know&lt;/span&gt;&lt;/h2&gt; &lt;p style="font-family: arial;"&gt;&lt;span style="font-size:85%;"&gt;Before you continue you should have a basic understanding of the following:&lt;/span&gt;&lt;/p&gt; &lt;ul style="font-family: arial;"&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;HTML / XHTML&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8707790305856929068-6936907088540762254?l=javascriptfactory.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javascriptfactory.blogspot.com/feeds/6936907088540762254/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://javascriptfactory.blogspot.com/2009/08/what-is-javascript.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8707790305856929068/posts/default/6936907088540762254'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8707790305856929068/posts/default/6936907088540762254'/><link rel='alternate' type='text/html' href='http://javascriptfactory.blogspot.com/2009/08/what-is-javascript.html' title='What is Javascript ?'/><author><name>Vipin C</name><uri>http://www.blogger.com/profile/01967245433419006643</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>
