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

<channel>
	<title>Techtracer &#187; JavaScript</title>
	<atom:link href="http://techtracer.com/category/javascript/feed/" rel="self" type="application/rss+xml" />
	<link>http://techtracer.com</link>
	<description>Tracing the course of Web Technology</description>
	<lastBuildDate>Mon, 26 Sep 2011 12:30:35 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.4</generator>
<image>
  <link>http://techtracer.com</link>
  <url>http://techtracer.com/wp-includes/images/favicon.png</url>
  <title>Techtracer</title>
</image>
		<item>
		<title>The Power of JavaScript Favelets</title>
		<link>http://techtracer.com/2008/01/27/the-power-of-javascript-favelets/</link>
		<comments>http://techtracer.com/2008/01/27/the-power-of-javascript-favelets/#comments</comments>
		<pubDate>Sun, 27 Jan 2008 14:25:52 +0000</pubDate>
		<dc:creator>nitinpai</dc:creator>
				<category><![CDATA[Featured]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://techtracer.com/2008/01/27/the-power-of-javascript-favelets/</guid>
		<description><![CDATA[Favelets are bookmarks which contain JavaScript code. The code is used in many forms either for fun purposes or for reducing routine tasks. In present times, you won&#8217;t require favelets much since browser&#8217;s have got upgraded to include plugins or come with inbuilt features. But still, if you are stuck with a browser which does [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Favelets</strong> are bookmarks which contain <strong>JavaScript</strong> code. The code is used in many forms either for fun purposes or for reducing routine tasks. In present times, you won&#8217;t require favelets much since browser&#8217;s have got upgraded to include plugins or come with inbuilt features. But still, if you are stuck with a browser which does not have such features or plugin facilities then favelets can be your saviour.</p>
<p style="text-align: center"><img src="http://techtracer.com/wp-content/uploads/2008/01/favelet.gif" alt="Favelet" /></p>
<p>A couple of days ago I was in such a situation. I am addicted to <strong>Firefox</strong> and already have a lot of plugins which increase my <strong>productivity</strong>. But in those couple of days, I was left with the dreadful <strong>Internet Explorer 6.0</strong>. Life became more difficult for me when I found myself opening up the Google homepage every time I wanted to search something. I did not have the rights to download the Google toolbar. But since I knew about Favelets I quickly made some and later found that even getting stuck with IE 6.0 did not matter any more.</p>
<p><strong>How to make a favelet?</strong></p>
<p>Suppose you are in a similar situation as mine and suppose you tend to search more in Google than do any other work. Without <strong>Google toolbar</strong> you would be just helpless. So I would explain here how to make a simple Google Search Favelet and a word-meaning finder.</p>
<p>Making a Favelet is not a difficult task. For a simple example, copy paste this line directly in your browser&#8217;s address bar.</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">javascript<span style="color: #339933;">:</span><span style="color: #000066;">alert</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;Hello World&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>When you hit enter it would show you the prompt with the message. You can do this in any browser.</p>
<p>Now that the idea is clear lets start with our Google Search favelet. Do the below steps:</p>
<ul>
<li>Create a new bookmark in your browser and name it &#8220;Google Search&#8221;</li>
<li>Put the below code in your bookmark location (the place where you put in the URL):</li>
</ul>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">javascript<span style="color: #339933;">:</span><span style="color: #003366; font-weight: bold;">var</span> keyword <span style="color: #339933;">=</span> <span style="color: #000066;">prompt</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'Enter Keyword'</span><span style="color: #339933;">,</span><span style="color: #3366CC;">''</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>if<span style="color: #009900;">&#40;</span>keyword<span style="color: #339933;">!=</span><span style="color: #3366CC;">''</span><span style="color: #339933;">&amp;</span>keyword<span style="color: #339933;">!=</span><span style="color: #003366; font-weight: bold;">null</span><span style="color: #009900;">&#41;</span>window.<span style="color: #000066;">open</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'http://www.google.com/search?hl=en&amp;q='</span> <span style="color: #339933;">+</span> keyword <span style="color: #339933;">+</span> <span style="color: #3366CC;">'&amp;btnG=Google+Search&amp;meta='</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>void <span style="color: #CC0000;">0</span></pre></div></div>

<ul>
<li>Remember to make the bookmark toolbar visible from your browsers menu for easier access.</li>
<li>Try it out, When you click it , a prompt will appear for keyword entry and on entry it will open a window to show you the results.</li>
<li>If you couldn&#8217;t make it, click <a href="javascript:var keyword = prompt('Enter Keyword','');if(keyword!=''&#038;keyword!=null)window.open('http://www.google.com/search?hl=en&#038;q=' + keyword + '&#038;btnG=Google+Search&#038;meta=');void 0" target="_blank">this link</a> or drag and drop the link on your bookmark toolbar.</li>
</ul>
<p><strong>Meaning Finder</strong></p>
<p>Suppose you are in a habit to find out the meanings of difficult words when you are surfing the web. You would find it distracting to open Google on another window and search the meaning of the word by copy pasting it. Having a favelet which can just catch the highlighted word on the page and then open up Google and automatically do a search on the word would be something you would crave for. Let&#8217;s try to extend the above created favelet to make this happen. The two additional things which are required in this case are:</p>
<ul>
<li>Using the <a href="http://techtracer.com/2008/01/06/10-most-amazing-google-search-tricks/">Google Trick</a> <strong>define:keyword</strong></li>
<li>JavaScript function <strong>document.getSelection();</strong></li>
<li>Create a new Favelet &#8220;Define&#8221; and put in the below code:</li>
</ul>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">javascript<span style="color: #339933;">:</span><span style="color: #003366; font-weight: bold;">var</span> keyword <span style="color: #339933;">=</span> document.<span style="color: #660066;">getSelection</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>if<span style="color: #009900;">&#40;</span>keyword<span style="color: #339933;">!=</span><span style="color: #3366CC;">''</span><span style="color: #339933;">&amp;</span>keyword<span style="color: #339933;">!=</span><span style="color: #003366; font-weight: bold;">null</span><span style="color: #009900;">&#41;</span>window.<span style="color: #000066;">open</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'http://www.google.com/search?hl=en&amp;q=define%3A'</span> <span style="color: #339933;">+</span> keyword <span style="color: #339933;">+</span> <span style="color: #3366CC;">'&amp;btnG=Google+Search'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>void <span style="color: #CC0000;">0</span></pre></div></div>

<ul>
<li>Drag n drop <a href="javascript:var keyword = document.getSelection();if(keyword!=''&#038;keyword!=null)window.open('http://www.google.com/search?hl=en&#038;q=define%3A' + keyword + '&#038;btnG=Google+Search');void 0" target="_blank">the link</a> to try the favelet. Select some word for which you want the meaning and then click the favelet on your bookmark toolbar. </li>
</ul>
<p><strong>Points to Ponder</strong></p>
<p>If you are a JavaScript veteran, you can try out many interesting and complex favelets which can reduce many of your tasks. But you have to remember that since JavaScript behaves differently in different browsers, you would have to make the necessary changes in your Favelets in order to make them generic to all browsers.</p>
<p>Many of the social networking site often have a <strong>bookmarklet </strong>(same as favelets) which help you to bookmark a page into their network. Some examples are:</p>
<ul>
<li><a href="http://reddit.com/bookmarklets" title="http://reddit.com/bookmarklets" target="_blank">Reditt Bookmarklets</a></li>
<li><a href="http://del.icio.us/help/buttons" title="http://del.icio.us/help/buttons" target="_blank">Del.icio.us Help Buttons</a></li>
</ul>
<p>Some other useful favelets which I have found from the web:</p>
<ul>
<li><a href="http://validator.w3.org/favelets.html" title="http://validator.w3.org/favelets.html" target="_blank">W3C Validator Favelets</a></li>
<li><a href="http://www.pixy.cz/pixylophone/favelets/" title="http://www.pixy.cz/pixylophone/favelets/" target="_blank">Web Design Test Favelets</a></li>
<li><a href="http://vedbaba.spaces.live.com/Blog/cns!C74A27CA0FF67D0D!146.entry" title="http://vedbaba.spaces.live.com/Blog/cns!C74A27CA0FF67D0D!146.entry" target="_blank">Favelets for Fun</a></li>
</ul>
<p>I hope you found this article interesting and if you create any interesting favelet don&#8217;t forget to mention it here.</p>
<h2>Related posts:</h2><ul><li><a href="http://techtracer.com/2008/02/16/power-of-xray-for-web-designers/" rel="bookmark" title="Permanent Link: Power of XRAY for Web Designers">Power of XRAY for Web Designers</a></li><li><a href="http://techtracer.com/2008/01/09/impressive-google-chart-generator-scripts/" rel="bookmark" title="Permanent Link: Impressive Google Chart Generator Scripts">Impressive Google Chart Generator Scripts</a></li><li><a href="http://techtracer.com/google-search/" rel="bookmark" title="Permanent Link: Search Results">Search Results</a></li><li><a href="http://techtracer.com/2007/03/27/ajax-frameworks-server-side-versus-client-side/" rel="bookmark" title="Permanent Link: Ajax Frameworks &#8211; Server side versus Client side">Ajax Frameworks &#8211; Server side versus Client side</a></li><li><a href="http://techtracer.com/2007/04/29/ajax-exposed-myth-and-reality/" rel="bookmark" title="Permanent Link: Ajax Exposed &#8211; Myth and Reality">Ajax Exposed &#8211; Myth and Reality</a></li></ul><br /><a href="http://techtracer.com/">Techtracer.com</a> Copyright &copy; 2008<br /> ]]></content:encoded>
			<wfw:commentRss>http://techtracer.com/2008/01/27/the-power-of-javascript-favelets/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Ajax Exposed &#8211; Myth and Reality</title>
		<link>http://techtracer.com/2007/04/29/ajax-exposed-myth-and-reality/</link>
		<comments>http://techtracer.com/2007/04/29/ajax-exposed-myth-and-reality/#comments</comments>
		<pubDate>Sun, 29 Apr 2007 17:00:00 +0000</pubDate>
		<dc:creator>nitinpai</dc:creator>
				<category><![CDATA[Ajax]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Web 2.0]]></category>

		<guid isPermaLink="false">http://techtracer.com/2007/04/29/ajax-exposed-myth-and-reality/</guid>
		<description><![CDATA[Ajax, from its onset, has seen many debates and discussions which not only have helped it flourish even more in its overall popularity but also have made it gain world wide acceptance and more standardized approach. However, there are still a lot of myths associated with Ajax and many of them have come out through [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Ajax</strong>, from its onset, has seen many debates and discussions which not only have helped it flourish even more in its overall popularity but also have made it gain world wide acceptance and more standardized approach. However, there are still a lot of myths associated with <strong>Ajax</strong> and many of them have come out through discussions in forums and through the blogosphere. This article tries to relate all of them and recall their origin and the realities attached behind the scenes.</p>
<p><u><strong>Ajax is not about XMLHttprequest Object</strong></u><br />
Most of the people think that if they know about the <strong>XMLHttpRequest</strong> (XHR) object then they are Ajax programmers. Only a part of this statement is true since the base of Ajax is about <strong>XHR</strong>. But Ajax is not just about <strong>XHR</strong>.</p>
<p><a href="http://www.adaptivepath.com/publications/essays/archives/000385.php">The article by Jesse James Garet</a> (who originally coined the term <strong>Ajax</strong>) mentions the same as,</p>
<blockquote><p>XMLHttpRequest is only part of the Ajax equation. XMLHttpRequest is the technical component that makes the asynchronous server communication possible; Ajax is our name for the overall approach described in the article, which relies not only on XMLHttpRequest, but on CSS, DOM, and other technologies.</p></blockquote>
<p>Working with Ajax means that you intend to use asynchronous behavior in your web page. The next thing which comes into practicality of Ajax usage is the <strong>XHR</strong> object. Although asynchronous, your web page will be far away from using Ajax in the right manner.</p>
<p>Ajax was not just meant for providing asynchronous behavior, but to make a web page shed its primitive look from blocking a view whenever a request was made to a look, which more seemed as if a person was working on his desktop application, by a combination of features provided through CSS, DOM, etc along with the specialty of <strong>XHR</strong>. The driving force to the popularity that Ajax has received is majorly speed and natural responsiveness which means that a response is generated to only what is demanded keeping the other things constant without changing.</p>
<p>Thus a person gives a preference more to a quick responsive page rather than the one which takes intervals in each and every request initiated and makes changes to the other things as well. <strong>XMLHttpRequest</strong> might be the base but along with the asynchronous behavior that <strong>XHR</strong> inherently provides you should be using it carefully with a proper separation of concerns between DOM, JavaScript and CSS along with XML, XSLT and XHTML.</p>
<p><strong><u>Ajax is not an acronym</u><br />
</strong>The fact is that, Ajax is just a shorthand for <em>Asynchronous JavaScript and XML</em>. When the Ajax hype happened about a year ago all the work done in Ajax was a miracle for those who hadn&#8217;t been much into the user interface driven aspects like CSS, JavaScript and XML. With the advent of Ajax, people have recently become more enthusiastic about<strong> JavaScript</strong> which was once a hated language by programmers amidst all the heavy duty strict counterparts like <strong>Java, C#,</strong> etc.</p>
<p>However, people failed to realize that this comparison was baseless since JavaScript was <strong>client side UI driven technology</strong> and had nothing to do with remote technology that Java, C# provided. Both belong to the different paradigms and cannot be compared. The name might itself suggest, JavaScript is nothing more than a scripting language for browsers in order to make the DOM active in its response. It is <strong>UI related</strong> and not meant for server side. However if you have used ASP you might disagree with this statement. But that is a different thing concerning with familiarity of JavaScript users for ASP using JavaScript.</p>
<p>In the <a href="http://www.gcn.com/blogs/tech/41547.html">Story behind Ajax</a>, <a href="http://jjg.net/">Garett</a> once again comes upfront to clearly mention this</p>
<blockquote><p>I thought of Ajax as a convenient [term]. It was never intended as an acronym.</p></blockquote>
<p><strong>Ajax</strong> came into the popularity charts due its <strong>catchy term</strong> and powerful way of representing a number of different things under its hood. Many JavaScript libraries which were providing a set of dynamic functionality to a web page became full fledged <strong>Ajax Toolkits</strong> since the emergence of this term. However if you see the source of these toolkits, you would come to know that they are a pure blend of many complicated modules involving CSS, XML, iFrames, Closures,etc.</p>
<p>The only place where the asynchronous behavior comes into picture is where the <strong>XHR</strong> object is used or where a graceful degradation in the form of an <strong>iFrame</strong> is provided for old browser compatibility. Rest of the rich interface experience is brought by other prior existing features like JavaScript special effects and utilities. Now these have come into limelight due to the coinage of the term &#8220;<strong>Ajax</strong>&#8220;. It can be compared to as a brand name rather than an paradigm shift.</p>
<p><u><strong>Ajax is not AJAX</strong></u><br />
When <strong>Jesse James Garett</strong> had coined the term <strong>Ajax</strong> it was used in <strong>camel case</strong>. But due to its expansion coming into the limelight as &#8220;<em>Asynchronous JavaScript and XML</em>&#8221; (notice the uppercase of the words) people represented it as <strong>AJAX</strong> and not <strong>Ajax</strong>. Much hue and uproar was made about this inclusion. Should Ajax or AJAX be used, is of more importance in the data driven aspects.</p>
<p>If you have a tool or search engine which you use to search case sensitive terms then using <em>Ajax</em> will fetch different results than <em>AJAX</em>. The same applies to using case sensitive <strong>switch cases</strong> in your applications which might be disturbing of search intensive applications. So it is required that people across the world stick to a single norm. The reference of the usage is correctly attributed to the creator of the term itself i.e <strong>Jesse James Garette</strong>. He used <strong>Ajax</strong> <em>(camel case)</em>. <a href="http://en.wikipedia.org/wiki/Ajax_%28programming%29">Wikipedia</a> also uses in the same way, alongwith many big vendors, so it ought to be <strong>Ajax</strong> and <strong>not AJAX</strong>.</p>
<p><strong>Arun Gupta</strong> recalls his experience in <a href="http://weblogs.java.net/blog/arungupta/archive/2007/04/ajax_vs_ajax_aj.html">making the changes at Sun Microsystems</a>.</p>
<blockquote><p>Ajax is a popular term for past few months but is still being written incorrectly as &#8220;AJAX&#8221; (all capitals) instead of &#8220;Ajax&#8221; (camel case). I started using AJAX but then corrected myself and have been using Ajax since then.</p></blockquote>
<p><strong>Arun</strong> has mentioned a set of nice resources which prove the need of using a globally accepted term. Its analogy can be put forward to the acceptance of English as a global language. Even this site needs to make the changes to the usages of the term <em>AJAX</em> wherever used. So if you are in the <em>AJAX</em> bandwagon it would be better to jump on to the <em>Ajax</em> one, due to the global directives.</p>
<p><u><strong>Ajax is not Web 2.0</strong></u><br />
<a href="http://en.wikipedia.org/wiki/Web_2.0">Web 2.0</a> is a conceptual term and rather a representational term which in recent times is being used on a tremendous scale to put forward the freedom of data usage on the web. Earlier the web was used to share data statically and allow limited interactions in the form of feedbacks from the user. But today if we see the web, its a lot more interactive and user has the power to generate content, publish at ease and choose various alternatives to acquire it.</p>
<p>The web sites today cater more to the user inputs rather than passive information being pushed to the users. The result being the increasing number of <strong>blogs, forums, social networks</strong> and <strong>communities</strong>. In addition to the increasing user interactions, Web 2.0 is about using data freely. There is no limitation to getting data only in a pre-specified format or a pre-specified contractual terms.</p>
<p>The user is free to choose how he can receive the same data in various ways. The proof of the fact is the number of technologies that are being built to cater to this aspect. <strong>Web Services, RSS Feeds, Webcasts, Podcasts</strong> etc. Spreading of data more accurately and in a wide spread manner is another aspect of Web 2.0. <strong>Tagging, Online bookmarking</strong> are only the beginning of such techniques and the web is about to see a lot more than this.</p>
<p>In his article, <strong>De Witt Clinton</strong> tries to showcase this is a rather detailed approach on <a href="http://blog.unto.net/work/on-web-20/">how communication has evolved,</a></p>
<blockquote><p>Web 2.0 is about giving up control. It is about setting the data free. It is about providing services that work with other peopleâ€™s data. It is about having a valuable resource and making no presumptions about how or where that resource will be used.</p></blockquote>
<p>In my opinion, the <strong>web</strong> just might become obsolete in the near future. The fact being it might be something closer to having <strong>online desktops</strong>. It might be possible that computers will be replaced entirely by mobiles which would become more handy than a computer, with power packed business and multimedia features.</p>
<p><strong>Ajax</strong> can be considered to as a part of the implementation process but not a concept of Web 2.0. <strong>Web 2.0</strong> is also just a term used to replace long statements indicating the changing nature of the web and not a replacement to the existing characteristics of the web, just like <strong>Ajax</strong> did to the underlying technologies. You might read about this aspect in <a href="http://en.wikipedia.org/wiki/Web_2.0#Criticism">Wikipedia&#8217;s information on Web 2.0</a>,</p>
<blockquote><p>The argument also exists that &#8220;Web 2.0&#8243; does not represent a new version of <a href="http://en.wikipedia.org/wiki/World_Wide_Web" title="World Wide Web">World Wide Web</a> at all, but merely continues to use &#8220;Web 1.0&#8243; technologies and concepts.</p></blockquote>
<p>The term <strong>Web 2.0</strong> showcases how data can be shared and used freely without any sort of restrictions while <strong>Ajax</strong> makes it possible to make innovations which attribute to the growth of <strong>Web 2.0</strong>. It&#8217;s more of a marketing strategy when you see <strong>Ajax</strong> and <strong>Web 2.0</strong> used as synonyms just to derive maximum popularity owing to the two latest terms coined. <strong>Web 2.0</strong> shows the way to <em>use</em> and <em>spread</em> data while <strong>Ajax</strong> is a practical approach to <em>present</em> the data in an effective and interactive manner.</p>
<h2>Related posts:</h2><ul><li><a href="http://techtracer.com/2007/12/01/nasa-adopts-ajax-launches-nasa-50/" rel="bookmark" title="Permanent Link: NASA adopts Ajax, Launches NASA 5.0">NASA adopts Ajax, Launches NASA 5.0</a></li><li><a href="http://techtracer.com/2007/03/21/5-tips-to-use-ajax-in-the-proper-way/" rel="bookmark" title="Permanent Link: 5 tips to use Ajax in the proper way">5 tips to use Ajax in the proper way</a></li><li><a href="http://techtracer.com/2007/03/12/the-birth-of-ajax-an-amazing-story/" rel="bookmark" title="Permanent Link: The birth of AJAX &#8211; an amazing story">The birth of AJAX &#8211; an amazing story</a></li><li><a href="http://techtracer.com/2007/07/23/servlet-30-the-journey-begins-now/" rel="bookmark" title="Permanent Link: Servlet 3.0 &#8211; The Journey Begins Now">Servlet 3.0 &#8211; The Journey Begins Now</a></li><li><a href="http://techtracer.com/2007/03/27/ajax-frameworks-server-side-versus-client-side/" rel="bookmark" title="Permanent Link: Ajax Frameworks &#8211; Server side versus Client side">Ajax Frameworks &#8211; Server side versus Client side</a></li></ul><br /><a href="http://techtracer.com/">Techtracer.com</a> Copyright &copy; 2008<br /> ]]></content:encoded>
			<wfw:commentRss>http://techtracer.com/2007/04/29/ajax-exposed-myth-and-reality/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Optimal use of Ajax &#8211; use Ajax the smart way</title>
		<link>http://techtracer.com/2007/04/10/optimal-use-of-ajax-use-web-20-the-smart-way/</link>
		<comments>http://techtracer.com/2007/04/10/optimal-use-of-ajax-use-web-20-the-smart-way/#comments</comments>
		<pubDate>Tue, 10 Apr 2007 16:47:06 +0000</pubDate>
		<dc:creator>nitinpai</dc:creator>
				<category><![CDATA[Ajax]]></category>
		<category><![CDATA[Concepts]]></category>
		<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://techtracer.com/2007/04/10/optimal-use-of-ajax-use-web-20-the-smart-way/</guid>
		<description><![CDATA[Web 2.0 is the thing that can make your site stand out from the hoard of web sites springing up day by day. But are they efficient enough to make a big impression? You need to analyze on some common principles to make the best impression. These principles make you use it in the smart [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Web 2.0 </strong>is the thing that can make your site stand out from the hoard of web sites springing up day by day. But are they efficient enough to make a big impression? You need to analyze on some common principles to make the best impression.  These principles make you use it in the smart way!  Web 2.0 today dominates mostly in the usage of <strong>Ajax today. </strong>I had written on how to go about <a href="http://techtracer.com/2007/03/26/first-step-in-ajax-choosing-the-right-framework/">choosing the right framework</a> and the <a href="http://techtracer.com/2007/03/27/ajax-frameworks-server-side-versus-client-side/">different types of frameworks</a> which are available to you to join the web 2.0 league. Today let&#8217;s see how can you can use <strong>Web 2.0</strong> features in the smart manner because the smartness will inspire others to work efficiently as well.<a href="http://techtracer.com/2007/03/26/first-step-in-ajax-choosing-the-right-framework/"><br />
</a></p>
<p>Looking at the features of <strong>Ajax</strong> that hundreds of frameworks today provide, you might get sometimes tempted to use them all. Its pleasing when the user interface is more interactive and more user friendly at the same time attractive. To make these you have to use the framework which provides such eye candy. But before you decide on a particular you must have these things in mind.</p>
<ol>
<li> Size of the total number of JavaScript pages</li>
<li>Check for frameworks or API for memory leaks</li>
<li>Don&#8217;t bloat your code</li>
<li>Use interactivity only where required</li>
<li>Don&#8217;t try to use <strong>Ajax</strong> where bookmarking is heavily used</li>
<li>Test your <strong>Ajax</strong> code properly</li>
</ol>
<p>Let&#8217;s see each one in detail.  </p>
<p>1. <em><strong>Size of the total number of JavaScript pages</strong></em><br />
This is one of the most important aspects when you go for deciding a framework. The JavaScript in the pages is nothing else than the code which the <strong>client has to download</strong>, in order to make available the features for the frameworks. If you find the download of a particular framework package very heavy then it would be the same feeling that the end user would be getting if you use the same framework API. This is because for using the eye candy features for the framework the end user&#8217;s browser would first download the JavaScript files and then execute the features.</p>
<p>2. <em><strong>Check for frameworks or API for memory leaks</strong></em><br />
This is the second most important thing you should watch out for. Normally while you program you work with an <strong>IDE</strong>. The IDE automatically alerts you when you make an infinite loop in your code accidentally. But when you code either in raw JavaScript or use any framework you do not have any IDE because there are not many good IDE&#8217;s that handle JavaScript well. So it might happen that you leave out a loop in a infinite manner or you could introduce a recursive functions which never ends. This often results in memory overloading on the client side thus crashing the browser or system. The other reasons for a memory leak might be the framework itself.</p>
<p>If you had seen the <strong>DOJO toolkit</strong> site earlier which works on DOJO you might have sometimes cursed the loading time for the site. Many a times my browser has crashed the moment I opened the site. This is because frameworks like DOJO implement the <strong>Ajax</strong> behavior and other features using a lot of code. And hence when the site loads the features use up the system memory for rendering the widgets in the browser.</p>
<p>3.<em><strong> Don&#8217;t bloat your code</strong></em><br />
Using some multiple free script&#8217;s is good but using multiple frameworks is a big no no. This is because of the same reason as stated in the earlier example. Bloating of code takes time to get downloaded and you can sometimes leave some part of the code unattended which results in memory leaks. Bloating of code can also occur if you unnecessary import all the necessary JavaScript file required for the entire website in a single page itself.</p>
<p>This is a common phenomenon since we generally put the import tags in the header files of the site. These header files are included in every page for displaying the header. But behind the load of each page the JavaScript files unnecessary get loaded into the browsers memory on the client side which slows down the execution of the site. In order to avoid this it is important that you just import the required JavaScript files in the appropriate pages and thus make the execution of the pages faster.</p>
<p>4. <em><strong>Use interactivity only where required</strong></em><br />
Never think in the manner that since your site is having the web 2.0 feature each and everything in it should be made via scripts. This is bad thinking. <strong>Ajax promotes interactivity</strong> hence it is must that you just make the page interactive when there are many components on the page. If you have <strong>personalized</strong> the Google homepage you might probably know about this very well. In the personal homepage you can see how convenient it is to modify a single component without disturbing the others. So <strong>Ajax</strong> fits in the picture in such a case.</p>
<p>Now lets take the example of a blog. On the homepage of a blog you see a list of posts and when you click the title of a post, the post page loads up. Now whether you simply load the page in the normal fashion or if <strong>Ajax</strong> is used in here,  <strong>the time taken is the same</strong>.  No fast loading takes place nor nothing on the site looks more appealing if Ajax is used in such situation since the data to be fetched from the server does not change.</p>
<p>The point I am trying to make is that Ajax should be used in those places where it solves some purpose and not in the places where it seems unnecessary. It is just a waste of time to put the efforts in this case.</p>
<p>5. <em><strong>Don&#8217;t try to use Ajax where bookmarking is heavily used.</strong></em><br />
If you are a blog owner then you might understand the importance of <strong>trackbacks</strong> or <strong>permalinks</strong>. Those are the blog&#8217;s savior since they are universally unique and reachable to any person who uses it whenever required. Ajax has a very undesirable feature which might make a blog less popular i.e <strong>Ajax pages cannot be bookmarked</strong>. If you use Ajax to load a post as I had mentioned in the example of point number 4. then the post loads up the same page <strong>without changing the URL</strong>. This is because it is loaded asynchronously.</p>
<p>Now if a person looks at such a loaded page and likes the content he might immediately bookmark without a second thought. But when he requests for the same page again.. voila! he doesn&#8217;t see the post. Instead he sees your homepage. Of course you can avoid this by explicitly specifying the trackback URL but you can never gaurantee that the reader of your content might be even knowledgeable of what <strong>Ajax</strong> is and what trackbacks are used for. Hence your blog traffic might suffer.</p>
<p>6. <em><strong>Test your Ajax code properly</strong></em><br />
There are not many testing tools available in the market nor very well practiced approaches for testing but you can be sure of making your code work properly by using some utilities which target the JavaScript behavior in the browser. One such utility is the <strong>FireBug </strong>which is absolutely marvelous when it comes to checking the Ajax code. I have not explored it completely but it helped to cure many bugs when I had worked in <strong>Ajax</strong> for a web application. It is freely available and comes as a <strong>plugin for Firefox. </strong>So make sure that you test the <strong>Ajax</strong> code to the maximum since a bug in the <strong>Ajax</strong> code can have many side effects.</p>
<h2>Related posts:</h2><ul><li><a href="http://techtracer.com/2007/12/01/nasa-adopts-ajax-launches-nasa-50/" rel="bookmark" title="Permanent Link: NASA adopts Ajax, Launches NASA 5.0">NASA adopts Ajax, Launches NASA 5.0</a></li><li><a href="http://techtracer.com/2007/03/21/5-tips-to-use-ajax-in-the-proper-way/" rel="bookmark" title="Permanent Link: 5 tips to use Ajax in the proper way">5 tips to use Ajax in the proper way</a></li><li><a href="http://techtracer.com/2007/07/23/servlet-30-the-journey-begins-now/" rel="bookmark" title="Permanent Link: Servlet 3.0 &#8211; The Journey Begins Now">Servlet 3.0 &#8211; The Journey Begins Now</a></li><li><a href="http://techtracer.com/2007/03/27/ajax-frameworks-server-side-versus-client-side/" rel="bookmark" title="Permanent Link: Ajax Frameworks &#8211; Server side versus Client side">Ajax Frameworks &#8211; Server side versus Client side</a></li><li><a href="http://techtracer.com/2007/07/15/xinu-ajax-based-site-statistics-tool/" rel="bookmark" title="Permanent Link: Xinu &#8211; Ajax Based Site Statistics Tool">Xinu &#8211; Ajax Based Site Statistics Tool</a></li></ul><br /><a href="http://techtracer.com/">Techtracer.com</a> Copyright &copy; 2008<br /> ]]></content:encoded>
			<wfw:commentRss>http://techtracer.com/2007/04/10/optimal-use-of-ajax-use-web-20-the-smart-way/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Ajax Frameworks &#8211; Server side versus Client side</title>
		<link>http://techtracer.com/2007/03/27/ajax-frameworks-server-side-versus-client-side/</link>
		<comments>http://techtracer.com/2007/03/27/ajax-frameworks-server-side-versus-client-side/#comments</comments>
		<pubDate>Tue, 27 Mar 2007 16:41:54 +0000</pubDate>
		<dc:creator>nitinpai</dc:creator>
				<category><![CDATA[Ajax]]></category>
		<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://techtracer.com/2007/03/27/ajax-frameworks-server-side-versus-client-side/</guid>
		<description><![CDATA[The advent of Ajax has brought about a lot of frameworks to the bill board, all boasting about their inept qualities in providing you the best from the rest. But how would you go about choosing a right kind of framework for your application. In order to make things simple, the overall horde of Ajax [...]]]></description>
			<content:encoded><![CDATA[<p>The advent of Ajax has brought about a lot of frameworks to the bill board, all boasting about their inept qualities in providing you the best from the rest. But how would you go about choosing a right kind of framework for your application.</p>
<p>In order to make things simple, the overall horde of Ajax frameworks can be classified into two major leagues:</p>
<ol>
<li>Server Side Framework</li>
<li>Client Side Frameworks</li>
</ol>
<p><em><strong>Server Side Frameworks<br />
</strong></em>Server side frameworks as the name suggests are <strong>used on the server side</strong>. But you would ask as to how Ajax, which involves JavaScript is used on the server side. Its not actually JavaScript that is used in such frameworks on the server side. In fact you use the same language API&#8217;s provided by the framework to do your client side activities and on deployment these client side activities coded on the server side get translated to normal Ajax functionalities when deployed. Confused? Let me clarify your this with an existing server side framework.</p>
<p><strong>Google Web Toolkit (GWT)</strong> is such a server side framework which is used as a normal Java Swing kind of programming on the server side in web pages using the GWT API. The GWT provides a tool for deploying your web application having such pages. During the deployment of the web application the GWT tools help in translating the Java syntax into the corresponding Ajax functionality to be brought on the client side.</p>
<p><em><strong> Advantage of Server Side Frameworks</strong></em><br />
The advantage of using a server side framework is that you use the existing language you are working in. You do not have to dwell in the wild wild world of JavaScript. Its easier to use a server side framework rather than to learn JavaScript.</p>
<p>Other server side frameworks are : <strong>Yahoo Toolkit, DWR </strong></p>
<p><em><strong>Client Side Frameworks</strong></em><br />
You must have done Ajax in the normal fashion using the <strong>XMLHTTPRequest</strong> object in a JavaScript file and then provided some callbacks to do the asynchronous requests. Providing this much is good enough for a simple Ajax page to do one or two requests. But in a large application much more functionality is required. I would list out some of these functionalities as follows:</p>
<ul>
<li><strong>Cross browser compatibility</strong> &#8211; When you code its always a necessity that the code works independent of the browser type requesting it</li>
<li><strong>Mutliple request handling</strong> &#8211; Multiple asynchronous request have to handled properly when doing the callbacks</li>
<li><strong>Graceful degradation</strong>  &#8211; You don&#8217;t want your code to fall flat on its face in case the browser does not support the XMLHTTPRequest object</li>
<li><strong>Exception and error handling</strong> &#8211; You should be able to catch the exceptions in your code instead of displaying it to the user</li>
</ul>
<p>To do all this yourself is very tedious and requires a lot of JavaScript expertise. To avoid all this mayhem you have client side frameworks to your rescue. They provide packages and API&#8217;s which help you to implement all of the above functionalities and also provide a lot of extra features which currently can be either found in free JavaScript code snippets over the net.</p>
<p>The extra features include <strong>widgets or even an IDE</strong>. <strong>Widgets</strong> are small interfaces or components which can be incorporated in an application easily through the client side frameworks. These widgets might compose of the following:</p>
<ol>
<li>Auto completing combobox</li>
<li>A Menu system</li>
<li>An accordian</li>
<li>A tabbed pane windows</li>
<li>Effects like fade, zoom in /out</li>
</ol>
<p><em><strong>Advantages of Client Side Frameworks</strong></em><br />
Besides the above specialties the advantage of a client side framework over a server side framework is that you have the complete flexibility in your hands. You can mix and match the widget features and at the same time provide extra flexibility as you have the world of JavaScript at your disposal. Some frameworks like <strong>TIBCO GI </strong>even provide a GUI to build your web pages with Ajax components in a complete drag n drop style.</p>
<p>The examples of a client side framework are <strong>Prototype, DOJO Toolkit, Rico, Script.aculo.us</strong>, etc.</p>
<p>Going out to choose a framework in the Ajax field can be a bit overwhelming  since you might think all look the same. But if you keep in mind the above classification then you can well have a feature matrix in front of you and also take less time in deciding on going for a particular one.</p>
<h2>Related posts:</h2><ul><li><a href="http://techtracer.com/2007/07/30/plagiarism-black-listing-of-sites-is-a-must/" rel="bookmark" title="Permanent Link: Plagiarism &#8211; Black Listing of Sites is a Must">Plagiarism &#8211; Black Listing of Sites is a Must</a></li><li><a href="http://techtracer.com/2007/03/26/first-step-in-ajax-choosing-the-right-framework/" rel="bookmark" title="Permanent Link: First step in Ajax &#8211; Choosing the right framework">First step in Ajax &#8211; Choosing the right framework</a></li><li><a href="http://techtracer.com/2007/03/21/5-tips-to-use-ajax-in-the-proper-way/" rel="bookmark" title="Permanent Link: 5 tips to use Ajax in the proper way">5 tips to use Ajax in the proper way</a></li><li><a href="http://techtracer.com/2007/04/10/optimal-use-of-ajax-use-web-20-the-smart-way/" rel="bookmark" title="Permanent Link: Optimal use of Ajax &#8211; use Ajax the smart way">Optimal use of Ajax &#8211; use Ajax the smart way</a></li><li><a href="http://techtracer.com/2007/07/23/servlet-30-the-journey-begins-now/" rel="bookmark" title="Permanent Link: Servlet 3.0 &#8211; The Journey Begins Now">Servlet 3.0 &#8211; The Journey Begins Now</a></li></ul><br /><a href="http://techtracer.com/">Techtracer.com</a> Copyright &copy; 2008<br /> ]]></content:encoded>
			<wfw:commentRss>http://techtracer.com/2007/03/27/ajax-frameworks-server-side-versus-client-side/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>5 tips to use Ajax in the proper way</title>
		<link>http://techtracer.com/2007/03/21/5-tips-to-use-ajax-in-the-proper-way/</link>
		<comments>http://techtracer.com/2007/03/21/5-tips-to-use-ajax-in-the-proper-way/#comments</comments>
		<pubDate>Wed, 21 Mar 2007 16:45:26 +0000</pubDate>
		<dc:creator>nitinpai</dc:creator>
				<category><![CDATA[Ajax]]></category>
		<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://techtracer.com/2007/03/21/5-tips-to-use-ajax-in-the-proper-way/</guid>
		<description><![CDATA[Ajax (Asynchronous JavaScript with XML) is used to provide a rich user interface, which allows the users to browse through a second component of a web page while the page fetches some data from some server for the first component. This type of request is called as an asynchronous request and it makes a web [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Ajax (Asynchronous JavaScript with XML)</strong> is used to provide a rich user interface, which allows the users to browse through a second component of a web page while the page fetches some data from some server for the first component. This type of request is called as an <strong>asynchronous request</strong> and it makes a web application more user-friendly since the request made does not block the user from doing other activities in the page.</p>
<p>This does not mean that all of the page content should be brought asynchronously as it would be the doing the same old things in a new fashion. AJAX promotes interactivity i.e. where in a web page which has a lot of components along with data to display to the user, some of the components can be dynamically updated without having to move the user away from the page for refreshing or doing some other activity. The user can access other components of the page while the update is in progress, which adds to the richness of the site or application. Web applications developed in this manner are called as a <strong>Rich Internet Applications (RIA).</strong></p>
<p>The 5 tips to use AJAX in the proper way are:</p>
<ol>
<li>Choose the right framework</li>
<li>Decide on a server side or a client side framework</li>
<li>Never bloat your code</li>
<li>Never try to ajaxify all the pages</li>
<li>Test your code properly</li>
</ol>
<p>I will be elaborating on each of these tips in the coming posts since they are have a detailed explanation and I will be providing some examples that I myself have come across and will relate the explanations to them.</p>
<h2>Related posts:</h2><ul><li><a href="http://techtracer.com/2007/12/26/techtracer-20-is-coming/" rel="bookmark" title="Permanent Link: Techtracer 2.0 is Coming">Techtracer 2.0 is Coming</a></li><li><a href="http://techtracer.com/2007/09/26/seo-for-wordpress-beginners/" rel="bookmark" title="Permanent Link: SEO for WordPress Beginners">SEO for WordPress Beginners</a></li><li><a href="http://techtracer.com/2007/10/10/resolving-the-unsupported-majorminor-version-490-error/" rel="bookmark" title="Permanent Link: Resolving the &#8220;Unsupported major.minor version 49.0&#8243; Error">Resolving the &#8220;Unsupported major.minor version 49.0&#8243; Error</a></li><li><a href="http://techtracer.com/2007/12/01/nasa-adopts-ajax-launches-nasa-50/" rel="bookmark" title="Permanent Link: NASA adopts Ajax, Launches NASA 5.0">NASA adopts Ajax, Launches NASA 5.0</a></li><li><a href="http://techtracer.com/2007/12/10/5-rules-for-a-good-web-design/" rel="bookmark" title="Permanent Link: 5 Rules For A Good Web Design">5 Rules For A Good Web Design</a></li></ul><br /><a href="http://techtracer.com/">Techtracer.com</a> Copyright &copy; 2008<br /> ]]></content:encoded>
			<wfw:commentRss>http://techtracer.com/2007/03/21/5-tips-to-use-ajax-in-the-proper-way/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

