<?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>Amit Yadav &#187; Javascript</title>
	<atom:link href="http://www.amityadav.name/category/javascript/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.amityadav.name</link>
	<description>Things to know for effective coding</description>
	<lastBuildDate>Fri, 19 Aug 2011 17:51:59 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>jQuery Custom Alertbox Plugin</title>
		<link>http://www.amityadav.name/jquery-custom-alertbox-plugin/</link>
		<comments>http://www.amityadav.name/jquery-custom-alertbox-plugin/#comments</comments>
		<pubDate>Tue, 20 Jul 2010 16:52:44 +0000</pubDate>
		<dc:creator>Amit</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Adobe AIR]]></category>
		<category><![CDATA[JQuery]]></category>
		<category><![CDATA[plugin]]></category>

		<guid isPermaLink="false">http://www.amityadav.name/?p=449</guid>
		<description><![CDATA[I was working on an app using Adobe AIR platform. At one stage i was at a point where i needed an alert system that i can customize according to my needs. I searched for some of the plugins that were very good but accidently i bumped into a link where it talks about how [...]]]></description>
			<content:encoded><![CDATA[<p>I was working on an app using Adobe AIR platform. At one stage i was at a point where i needed an alert system that i can customize according to my needs. I searched for some of the plugins that were very good but accidently i bumped into a link where it talks about how to create a jQuery plugin, so i thought of creating my own which i can customize according to my needs.<br />
I am providing the code here so that you can use this code and customize it according to your need.</p>

<div class="wp_codebox_msgheader wp_codebox_hide"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p449code2'); return false;">View Code</a> SCRIPT</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p4492"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
</pre></td><td class="code" id="p449code2"><pre class="script" style="font-family:monospace;">//PLUGIN FOR THE NEW ALERT BOX
 (function($){  
	 $.fn.extend({   
		 customAlert: function(options) {
			var htmlStr = '&lt;div id=&quot;amitOverlay&quot;&gt;&lt;/div&gt;&lt;div id=&quot;alertMsgDiv&quot;&gt;&lt;div id=&quot;aClose&quot;&gt;[X]&lt;/div&gt;&lt;div id=&quot;aMessage&quot;&gt;&lt;/div&gt;&lt;/div&gt;';
			var defaults = {   
				 bgColor: '#000',  
				 opacity: '0.6',  
				 message: 'This is a test message from the plugin',  
			 };  
&nbsp;
			var options = $.extend(defaults, options);  
			$(&quot;body&quot;).append(htmlStr);
			$(&quot;#alertMsgDiv&quot;).css({'display': 'block', 'width': '100px'});
			$(&quot;#amitOverlay&quot;).css({'display': 'block', 'top': '0px', 'left': '0px', 'width': $(this).width() + &quot;px&quot;, 'height': $(this).height() + &quot;px&quot;, 'background-color': options.bgColor, 'opacity': options.opacity});	
&nbsp;
			$(&quot;#aMessage&quot;).html(options.message);
			$(&quot;#alertMsgDiv&quot;).animate({width: 300}, 300);
&nbsp;
			$(&quot;#amitOverlay, #aClose&quot;).click(function(){	
				$(&quot;#alertMsgDiv&quot;).remove();
				$(&quot;#amitOverlay&quot;).remove();									
			});
		 }  
	 });  
 })(jQuery);
&nbsp;
&nbsp;
/*
 USAGE
 $(document).ready(function(){
	$(document).customAlert({opacity:0.4, bgColor: &quot;#aaa&quot;,  message: 'This is a test message' });
 });
 */</pre></td></tr></table></div>

<div>Download the code <a title="Code" href="http://amityadav.name/customAlert.rar" target="_blank">here</a></div>
<div class="zemanta-pixie" style="margin-top: 10px; height: 15px;"><img class="zemanta-pixie-img" style="border: none; float: right;" src="http://img.zemanta.com/pixy.gif?x-id=e1d2ec40-6735-4b17-acf0-a009f6050a0a" alt="" /><span class="zem-script more-related pretty-attribution"><script src="http://static.zemanta.com/readside/loader.js" type="text/javascript"></script></span></div>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.amityadav.name%2Fjquery-custom-alertbox-plugin%2F&amp;title=jQuery%20Custom%20Alertbox%20Plugin" id="wpa2a_2"><img src="http://www.amityadav.name/wp-content/plugins/add-to-any/share_save_171_16.gif" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.amityadav.name/jquery-custom-alertbox-plugin/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>QUnit:JavaScript Testing Framework</title>
		<link>http://www.amityadav.name/qunitjavascript-testing-framework/</link>
		<comments>http://www.amityadav.name/qunitjavascript-testing-framework/#comments</comments>
		<pubDate>Tue, 16 Feb 2010 07:07:40 +0000</pubDate>
		<dc:creator>Amit</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[JQuery]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[QUnit]]></category>
		<category><![CDATA[Unit testing]]></category>

		<guid isPermaLink="false">http://www.amityadav.name/?p=401</guid>
		<description><![CDATA[QUnit is a powerful JavaScript unit testing framework that helps you to debug code. It&#8217;s written by members of the jQuery team, and is the official test suite for jQuery. But QUnit is general enough to test any regular JavaScript code, and it&#8217;s even able to test server-side JavaScript via some JavaScript engine like Rhino [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://docs.jquery.com/QUnit">QUnit</a> is a powerful  <a class="zem_slink" title="JavaScript" rel="wikipedia" href="http://en.wikipedia.org/wiki/JavaScript">JavaScript</a> <a class="zem_slink" title="Unit testing" rel="wikipedia" href="http://en.wikipedia.org/wiki/Unit_testing">unit testing</a> framework that helps you to debug code. It&#8217;s  written by members of the <a href="http://jquery.com/">jQuery</a> team,  and is the official <a class="zem_slink" title="Test suite" rel="wikipedia" href="http://en.wikipedia.org/wiki/Test_suite">test suite</a> for jQuery. But QUnit is general enough  to test any regular JavaScript code, and it&#8217;s even able to test  server-side JavaScript via some JavaScript engine like Rhino or V8.</p>
<p>If you&#8217;re unfamiliar with the idea of &#8220;unit testing&#8221;, don&#8217;t worry.  It&#8217;s not too difficult to understand:</p>
<blockquote><p><em>In <a class="zem_slink" title="Computer programming" rel="wikipedia" href="http://en.wikipedia.org/wiki/Computer_programming">computer programming</a>, unit testing is a <a class="zem_slink" title="Software verification" rel="wikipedia" href="http://en.wikipedia.org/wiki/Software_verification">software  verification</a> and validation method in which a programmer tests if  individual units of <a class="zem_slink" title="Source code" rel="wikipedia" href="http://en.wikipedia.org/wiki/Source_code">source code</a> are fit for use. A unit is the smallest  testable part of an <a class="zem_slink" title="Computer software" rel="wikipedia" href="http://en.wikipedia.org/wiki/Computer_software">application</a>. In <a class="zem_slink" title="Procedural programming" rel="wikipedia" href="http://en.wikipedia.org/wiki/Procedural_programming">procedural</a> programming a unit may be  an individual function or procedure.</em></p></blockquote>
<p>This is quoted from Wikipedia. Simply put, you write tests for each  functionality of your code, and if all of these tests are passed, you  can be sure that the code will be bug-free (mostly, depends on how  thorough your tests are).</p>
<div class="zemanta-pixie" style="margin-top: 10px; height: 15px;"><img class="zemanta-pixie-img" style="border: medium none; float: right;" src="http://img.zemanta.com/pixy.gif?x-id=e724939f-b2c3-4f20-94a2-a746f45ee97f" alt="" /><span class="zem-script more-related pretty-attribution"><script src="http://static.zemanta.com/readside/loader.js" type="text/javascript"></script></span></div>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.amityadav.name%2Fqunitjavascript-testing-framework%2F&amp;title=QUnit%3AJavaScript%20Testing%20Framework" id="wpa2a_4"><img src="http://www.amityadav.name/wp-content/plugins/add-to-any/share_save_171_16.gif" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.amityadav.name/qunitjavascript-testing-framework/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>jQuery: Traversing the siblings</title>
		<link>http://www.amityadav.name/jquery-traversing-the-siblings-2/</link>
		<comments>http://www.amityadav.name/jquery-traversing-the-siblings-2/#comments</comments>
		<pubDate>Fri, 29 Jan 2010 07:29:49 +0000</pubDate>
		<dc:creator>Amit</dc:creator>
				<category><![CDATA[Javascript]]></category>

		<guid isPermaLink="false">http://www.amityadav.name/?p=390</guid>
		<description><![CDATA[The code here traverses through the siblings of the anchor tags. One of the guy at OZZU Forum was having this problem, so thought of putting the code on my blog too.]]></description>
			<content:encoded><![CDATA[<p>The code here traverses through the siblings of the anchor tags. One of the guy at <a href="http://www.ozzu.com/programming-forum/confusing-traversal-with-jquery-t102056.html#p569954" target="_blank">OZZU Forum</a> was having this problem, so thought of putting the code on my blog too.</p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.amityadav.name%2Fjquery-traversing-the-siblings-2%2F&amp;title=jQuery%3A%20Traversing%20the%20siblings" id="wpa2a_6"><img src="http://www.amityadav.name/wp-content/plugins/add-to-any/share_save_171_16.gif" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.amityadav.name/jquery-traversing-the-siblings-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Firebug 1.5.0</title>
		<link>http://www.amityadav.name/firebug-150/</link>
		<comments>http://www.amityadav.name/firebug-150/#comments</comments>
		<pubDate>Fri, 22 Jan 2010 10:24:50 +0000</pubDate>
		<dc:creator>Amit</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Firebug]]></category>
		<category><![CDATA[Firefox]]></category>

		<guid isPermaLink="false">http://www.amityadav.name/?p=361</guid>
		<description><![CDATA[Mike Radcliffe’s Inspector. A key feature, now solid as a rock, Jan ‘Honza’ Odvarko’s expanded and refined Net panel, with accurate timings, Steve Roussey’s reworking of HTML editing and entity support, Kevin Decker’s CSS and Style side panel improvements, Support for dynamic, graphical breakpoints through out Firebug. Tested support for the soon-to-be-released Firefox 3.6]]></description>
			<content:encoded><![CDATA[<ul>
<li>Mike Radcliffe’s Inspector. A key feature, now solid as a rock,</li>
<li>Jan ‘Honza’ Odvarko’s expanded and refined Net panel, with accurate timings,</li>
<li>Steve Roussey’s reworking of HTML editing and entity support,</li>
<li>Kevin Decker’s <a class="zem_slink" href="http://en.wikipedia.org/wiki/Cascading_Style_Sheets" title="Cascading Style Sheets" rel="wikipedia">CSS</a> and Style side panel improvements,</li>
<li>Support for dynamic, graphical breakpoints through out <a class="zem_slink" href="http://getfirebug.com" title="Firebug" rel="homepage">Firebug</a>.</li>
<li>Tested support for the soon-to-be-released Firefox 3.6</li>
</ul>
<div style="margin-top: 10px; height: 15px;" class="zemanta-pixie"><img style="border: medium none ; float: right;" class="zemanta-pixie-img" alt="" src="http://img.zemanta.com/pixy.gif?x-id=67a8a01a-7885-4dfa-a957-4484efe65f2c"><span class="zem-script more-related pretty-attribution"><script type="text/javascript" src="http://static.zemanta.com/readside/loader.js" defer="defer"></script></span></div>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.amityadav.name%2Ffirebug-150%2F&amp;title=Firebug%201.5.0" id="wpa2a_8"><img src="http://www.amityadav.name/wp-content/plugins/add-to-any/share_save_171_16.gif" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.amityadav.name/firebug-150/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Javascript: visual event</title>
		<link>http://www.amityadav.name/javascript-visual-event/</link>
		<comments>http://www.amityadav.name/javascript-visual-event/#comments</comments>
		<pubDate>Tue, 19 May 2009 06:21:54 +0000</pubDate>
		<dc:creator>Amit</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Bookmarklet]]></category>
		<category><![CDATA[Firebug]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.amityadav.name/?p=320</guid>
		<description><![CDATA[When working with events in Javascript, it is often easy to loose track of what events are subscribed where. This is particularly true if you are using a large number of events, which is typical in a modern interface employing progressive enhancement. Javascript libraries also add another degree of complexity to listeners from a technical [...]]]></description>
			<content:encoded><![CDATA[<p>When working with events in <a class="zem_slink" title="JavaScript" rel="wikipedia" href="http://en.wikipedia.org/wiki/JavaScript">Javascript</a>, it is often easy to loose track of what events are subscribed where. This is particularly true if you are using a large number of events, which is typical in a modern interface employing progressive enhancement. Javascript libraries also add another degree of complexity to listeners from a technical point of view, while from a developers point of view they of course can make life much easier! But when things go wrong it can be difficult to trace down why this might be.</p>
<p><img src="http://www.sprymedia.co.uk/design/event/reflection/small.jpg" alt="" /></p>
<p>It is due to this <a href="http://www.sprymedia.co.uk/">allan jardine</a> put together a Javascript bookmarklet called <em>Visual Event</em> which visually shows the elements on a page that have events subscribed to them, what those events are and the function that the event would run when triggered. This is primarily intended to assist debugging, but it can also be very interesting and informative to see the subscribed events on other pages.</p>
<div class="center"></div>
<div class="zemanta-pixie" style="margin-top: 10px; height: 15px;"><img class="zemanta-pixie-img" style="border: none; float: right;" src="http://img.zemanta.com/pixy.gif?x-id=722f7485-9a13-4e37-911d-e3b40d0a6f72" alt="" /><span class="zem-script more-related pretty-attribution"><script src="http://static.zemanta.com/readside/loader.js" type="text/javascript"></script></span></div>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.amityadav.name%2Fjavascript-visual-event%2F&amp;title=Javascript%3A%20visual%20event" id="wpa2a_10"><img src="http://www.amityadav.name/wp-content/plugins/add-to-any/share_save_171_16.gif" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.amityadav.name/javascript-visual-event/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>PhoneGap: Cross Platform Mobile Framework</title>
		<link>http://www.amityadav.name/phonegap-cross-platform-mobile-framework/</link>
		<comments>http://www.amityadav.name/phonegap-cross-platform-mobile-framework/#comments</comments>
		<pubDate>Tue, 19 May 2009 04:50:32 +0000</pubDate>
		<dc:creator>Amit</dc:creator>
				<category><![CDATA[Internet News]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[mobile]]></category>
		<category><![CDATA[Android]]></category>
		<category><![CDATA[Apple]]></category>
		<category><![CDATA[IPhone]]></category>
		<category><![CDATA[iPhone 3G]]></category>
		<category><![CDATA[OpenSource]]></category>

		<guid isPermaLink="false">http://www.amityadav.name/?p=316</guid>
		<description><![CDATA[PhoneGap is an open source development tool for building fast, easy mobile apps with JavaScript. If you’re a web developer who wants to build mobile applications in HTML and JavaScript while still taking advantage of the core features in the iPhone, Android and Blackberry SDKs, PhoneGap is for you. Supported Features iPhone Android Blackberry Geo [...]]]></description>
			<content:encoded><![CDATA[<p>PhoneGap is an open source development tool for building fast, easy mobile apps with <a class="zem_slink" title="JavaScript" rel="wikipedia" href="http://en.wikipedia.org/wiki/JavaScript">JavaScript</a>.</p>
<p>If you’re a web developer who wants to build mobile applications in <a class="zem_slink" title="HTML" rel="wikipedia" href="http://en.wikipedia.org/wiki/HTML">HTML</a> and JavaScript while still taking advantage of the core features in the <a class="zem_slink" title="iPhone 3G" rel="homepage" href="http://www.apple.com/iphone">iPhone</a>, <a class="zem_slink" title="Android" rel="homepage" href="http://code.google.com/android/">Android</a> and Blackberry <a class="zem_slink" title="Software development kit" rel="wikipedia" href="http://en.wikipedia.org/wiki/Software_development_kit">SDKs</a>, PhoneGap is for you.</p>
<h2 class="support">Supported Features</h2>
<table class="support" border="0" cellspacing="0">
<tbody>
<tr>
<th class="upperleft"></th>
<th>iPhone</th>
<th>Android</th>
<th>Blackberry</th>
</tr>
<tr class="odd top">
<td class="device">Geo Location</td>
<td class="accept">yes</td>
<td class="accept">yes</td>
<td class="accept">yes</td>
</tr>
<tr>
<td class="device">Vibration</td>
<td class="accept">yes</td>
<td class="accept">yes</td>
<td>pending</td>
</tr>
<tr class="odd">
<td class="device">Accelerometer</td>
<td class="accept">yes</td>
<td class="accept">yes</td>
<td>pending</td>
</tr>
<tr>
<td class="device">Sound</td>
<td class="accept">yes</td>
<td class="accept">yes</td>
<td>pending</td>
</tr>
<tr class="odd">
<td class="device">Contact Support</td>
<td class="accept">yes</td>
<td>pending</td>
<td>pending</td>
</tr>
</tbody>
</table>
<p>PhoneGap aims to solve device integration by web     enabling devices native functionality with open standards.</p>
<p>Above all its totally an open source, hurray&#8230;</p>
<p>Here is what the creators of PhoneGap say:<br />
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="320" height="240" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="src" value="http://blip.tv/play/xAzxwhuDxWs" /><embed type="application/x-shockwave-flash" width="320" height="240" src="http://blip.tv/play/xAzxwhuDxWs"></embed></object></p>
<div class="zemanta-pixie" style="margin-top: 10px; height: 15px;"><img class="zemanta-pixie-img" style="border: none; float: right;" src="http://img.zemanta.com/pixy.gif?x-id=0e20d6fa-e30c-467e-b882-1369ef7a7b9e" alt="" /><span class="zem-script more-related pretty-attribution"><script src="http://static.zemanta.com/readside/loader.js" type="text/javascript"></script></span></div>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.amityadav.name%2Fphonegap-cross-platform-mobile-framework%2F&amp;title=PhoneGap%3A%20Cross%20Platform%20Mobile%20Framework" id="wpa2a_12"><img src="http://www.amityadav.name/wp-content/plugins/add-to-any/share_save_171_16.gif" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.amityadav.name/phonegap-cross-platform-mobile-framework/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Decision Center for Ajax Frameworks</title>
		<link>http://www.amityadav.name/decision-center-for-ajax-frameworks/</link>
		<comments>http://www.amityadav.name/decision-center-for-ajax-frameworks/#comments</comments>
		<pubDate>Mon, 18 May 2009 04:20:14 +0000</pubDate>
		<dc:creator>Amit</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[AJAX]]></category>
		<category><![CDATA[Athenz]]></category>

		<guid isPermaLink="false">http://www.amityadav.name/?p=305</guid>
		<description><![CDATA[Briggs of Athenz has pointed his decision machine at the age old problem of choosing which darn library to choose. Now let the machine choose which library to use rather you choosing the library. Briggs has developed an application that chooses the Framework for you. http://www.athenz.com/app/decision/center/ajax A collaborative decision platform that is designed to help [...]]]></description>
			<content:encoded><![CDATA[<p><a class="zem_slink" title="Johnny Briggs (cricketer)" rel="wikipedia" href="http://en.wikipedia.org/wiki/Johnny_Briggs_%28cricketer%29">Briggs</a> of Athenz has pointed his decision machine at the age old problem of choosing which darn library to choose. Now let the machine choose which library to use rather you choosing the library.</p>
<p>Briggs has developed an application that chooses the Framework for you.</p>
<p><a href="http://www.athenz.com/app/decision/center/ajax" target="_blank">http://www.athenz.com/app/decision/center/ajax</a></p>
<p><span class="definition">A </span><strong><span class="definition">collaborative decision platform </span></strong>that is designed to help you make better technology decisions.</p>
<p>A sophisticated, yet friendly decision engine to help you prioritize, compare, assess, and synthesize.</p>
<div class="zemanta-pixie" style="margin-top: 10px; height: 15px;"><img class="zemanta-pixie-img" style="border:none;float:right" src="http://img.zemanta.com/pixy.gif?x-id=930dfedc-8537-460c-bf64-37fbbbea44b1" alt="" /><span class="zem-script more-related pretty-attribution"><script src="http://static.zemanta.com/readside/loader.js" type="text/javascript"></script></span></div>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.amityadav.name%2Fdecision-center-for-ajax-frameworks%2F&amp;title=Decision%20Center%20for%20Ajax%20Frameworks" id="wpa2a_14"><img src="http://www.amityadav.name/wp-content/plugins/add-to-any/share_save_171_16.gif" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.amityadav.name/decision-center-for-ajax-frameworks/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>YUI3 &#8211; Satyen Desai</title>
		<link>http://www.amityadav.name/yui3-satyen-desai/</link>
		<comments>http://www.amityadav.name/yui3-satyen-desai/#comments</comments>
		<pubDate>Mon, 18 May 2009 04:10:15 +0000</pubDate>
		<dc:creator>Amit</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[yahoo]]></category>

		<guid isPermaLink="false">http://www.amityadav.name/?p=303</guid>
		<description><![CDATA[Satyen Desai: &#8220;YUI 3: Design Goals and Architecture&#8221; @ Yahoo! Video]]></description>
			<content:encoded><![CDATA[<div><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="512" height="322" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="AllowScriptAccess" value="always" /><param name="bgcolor" value="#000000" /><param name="flashVars" value="id=13406817&amp;vid=5044557&amp;lang=en-us&amp;intl=us&amp;thumbUrl=http%3A//l.yimg.com/a/p/i/bcst/videosearch/8818/85299985.jpeg&amp;embed=1" /><param name="src" value="http://d.yimg.com/static.video.yahoo.com/yep/YV_YEP.swf?ver=2.2.40" /><embed type="application/x-shockwave-flash" width="512" height="322" src="http://d.yimg.com/static.video.yahoo.com/yep/YV_YEP.swf?ver=2.2.40" flashvars="id=13406817&amp;vid=5044557&amp;lang=en-us&amp;intl=us&amp;thumbUrl=http%3A//l.yimg.com/a/p/i/bcst/videosearch/8818/85299985.jpeg&amp;embed=1" bgcolor="#000000" allowscriptaccess="always" allowfullscreen="true"></embed></object><br />
<a href="http://video.yahoo.com/watch/5044557/13406817">Satyen Desai: &#8220;YUI 3: Design Goals and Architecture&#8221;</a> @ <a href="http://video.yahoo.com">Yahoo! Video</a></div>
<div class="zemanta-pixie" style="margin-top: 10px; height: 15px;"><img class="zemanta-pixie-img" style="border: none; float: right;" src="http://img.zemanta.com/pixy.gif?x-id=13c93303-3b70-48ff-8d16-d42ff3451990" alt="" /><span class="zem-script more-related pretty-attribution"><script src="http://static.zemanta.com/readside/loader.js" type="text/javascript"></script></span></div>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.amityadav.name%2Fyui3-satyen-desai%2F&amp;title=YUI3%20%26%238211%3B%20Satyen%20Desai" id="wpa2a_16"><img src="http://www.amityadav.name/wp-content/plugins/add-to-any/share_save_171_16.gif" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.amityadav.name/yui3-satyen-desai/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>jsPDF: PDF documents using pure JavaScript</title>
		<link>http://www.amityadav.name/jspdf-pdf-documents-using-pure-javascript/</link>
		<comments>http://www.amityadav.name/jspdf-pdf-documents-using-pure-javascript/#comments</comments>
		<pubDate>Sun, 26 Apr 2009 19:24:24 +0000</pubDate>
		<dc:creator>Amit</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[IPhone]]></category>
		<category><![CDATA[Opera]]></category>
		<category><![CDATA[Safari]]></category>

		<guid isPermaLink="false">http://www.amityadav.name/?p=269</guid>
		<description><![CDATA[jsPDF is an open-source library for generating PDF documents using nothing but Javascript. You can use it in a Firefox extension, in Server Side Javascript and with Data URIs in some browsers. See Demo Client-side demo works best in Safari or iPhone Safari. Also works Firefox 3 on Windows and Opera. IE support on the [...]]]></description>
			<content:encoded><![CDATA[<p>jsPDF is an open-source library for generating PDF documents using nothing but <a class="zem_slink" title="JavaScript" rel="wikipedia" href="http://en.wikipedia.org/wiki/JavaScript">Javascript</a>. You can use it in a <a class="zem_slink" title="Mozilla Firefox" rel="geolocation" href="http://maps.google.com/maps?ll=45.1238,-123.1138&amp;spn=1.0,1.0&amp;q=45.1238,-123.1138%20%28Mozilla%20Firefox%29&amp;t=h">Firefox</a> extension, in Server Side Javascript and with Data URIs in some browsers.</p>
<p><a href="http://jspdf.googlecode.com/svn/trunk/examples/basic.htm">See Demo</a></p>
<p>Client-side demo works best in <a class="zem_slink" title="Safari (web browser)" rel="homepage" href="http://www.apple.com/safari/">Safari</a> or <a class="zem_slink" title="iPhone" rel="homepage" href="http://www.apple.com/iphone">iPhone</a> Safari. Also works Firefox 3 on Windows and <a class="zem_slink" title="Opera Software" rel="homepage" href="http://www.opera.com">Opera</a>. IE support on the way.<br />
Server-side should work anywhere. Examples soon.</p>
<div class="zemanta-pixie" style="margin-top: 10px; height: 15px;"><img class="zemanta-pixie-img" style="border: medium none; float: right;" src="http://img.zemanta.com/pixy.gif?x-id=306787cb-2c40-4373-82cc-cd5b024ef83d" alt="" /><span class="zem-script more-related pretty-attribution"><script src="http://static.zemanta.com/readside/loader.js" type="text/javascript"></script></span></div>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.amityadav.name%2Fjspdf-pdf-documents-using-pure-javascript%2F&amp;title=jsPDF%3A%20PDF%20documents%20using%20pure%20JavaScript" id="wpa2a_18"><img src="http://www.amityadav.name/wp-content/plugins/add-to-any/share_save_171_16.gif" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.amityadav.name/jspdf-pdf-documents-using-pure-javascript/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Using JQuery &amp; Prototype together</title>
		<link>http://www.amityadav.name/using-jquery-prototype-together/</link>
		<comments>http://www.amityadav.name/using-jquery-prototype-together/#comments</comments>
		<pubDate>Sat, 25 Apr 2009 19:25:47 +0000</pubDate>
		<dc:creator>Amit</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[AJAX]]></category>
		<category><![CDATA[JQuery]]></category>
		<category><![CDATA[MooTools]]></category>
		<category><![CDATA[Prototype JavaScript Framework]]></category>
		<category><![CDATA[Yui]]></category>

		<guid isPermaLink="false">http://www.amityadav.name/?p=255</guid>
		<description><![CDATA[You would surely have used JQuery and Prototype for dynamic web applications like Lightview, Prototip, etc. Here i would show you how to user them two together, on the same page. Problem The Problem JQuery uses a “$” as a shortcut for “jQuery” and Prototype uses “$” as well. We can’t have JQuery and Prototype [...]]]></description>
			<content:encoded><![CDATA[<p>You would surely have used JQuery and <a class="zem_slink" title="Prototype JavaScript Framework" rel="homepage" href="http://prototypejs.org">Prototype</a> for dynamic web applications like Lightview, Prototip, etc. Here i would show you how to user them two together, on the same page.</p>
<p><strong>Problem</strong><br />
The Problem JQuery uses a “$” as a shortcut for “jQuery” and Prototype uses “$” as well. We can’t have JQuery and Prototype using the same “$” namespace.</p>
<p><strong>The Fix</strong><br />
Thankfully JQuery has a neat little function called jQuery.noConflict( ) which you basically just need to stick at the top of your JQuery file and replace the “$” alias with “jQuery” for each function. Example:</p>
<p><span style="color: #800000;">jQuery.noConflict();<br />
// Do something with jQuery<br />
jQuery(&#8220;div p&#8221;).hide();<br />
// Do something with another library&#8217;s $()<br />
$(&#8220;content&#8221;).style.display = &#8216;none&#8217;;</span></p>
<p>Of course, there are other ways of solving this issue with jQuery.noConflict( )</p>
<p>NOTE: JQuery doesn’t get along with <a class="zem_slink" title="MooTools" rel="homepage" href="http://mootools.net">MooTools</a> and <a class="zem_slink" title="Yui (singer)" rel="imdb" href="http://www.imdb.com/name/nm2065262/">YUI</a> very well either, luckily this can also be solved with the jQuery.noConflict( ) trick.</p>
<div class="zemanta-pixie" style="margin-top: 10px; height: 15px;"><img class="zemanta-pixie-img" style="border: medium none; float: right;" src="http://img.zemanta.com/pixy.gif?x-id=f1a1174b-f24b-48cf-aa25-44bd8eaa905d" alt="" /><span class="zem-script more-related pretty-attribution"><script src="http://static.zemanta.com/readside/loader.js" type="text/javascript"></script></span></div>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.amityadav.name%2Fusing-jquery-prototype-together%2F&amp;title=Using%20JQuery%20%26%23038%3B%20Prototype%20together" id="wpa2a_20"><img src="http://www.amityadav.name/wp-content/plugins/add-to-any/share_save_171_16.gif" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.amityadav.name/using-jquery-prototype-together/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Javascript Best Practices</title>
		<link>http://www.amityadav.name/javascript-best-practices/</link>
		<comments>http://www.amityadav.name/javascript-best-practices/#comments</comments>
		<pubDate>Fri, 20 Feb 2009 04:42:45 +0000</pubDate>
		<dc:creator>Amit</dc:creator>
				<category><![CDATA[Javascript]]></category>

		<guid isPermaLink="false">http://www.amityadav.name/?p=213</guid>
		<description><![CDATA[Javascript Best Practices View more presentations from Christian Heilmann. (tags: webdevtrick tips)]]></description>
			<content:encoded><![CDATA[<div id="__ss_1041724" style="width: 425px; text-align: left;"><a style="font:14px Helvetica,Arial,Sans-serif;display:block;margin:12px 0 3px 0;text-decoration:underline;" title="Javascript Best Practices" href="http://www.slideshare.net/cheilmann/javascript-best-practices-1041724?type=presentation">Javascript Best Practices</a><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="425" height="355" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="allowScriptAccess" value="always" /><param name="src" value="http://static.slideshare.net/swf/ssplayer2.swf?doc=javascriptbestpractices-1234957342527920-2&amp;stripped_title=javascript-best-practices-1041724" /><embed type="application/x-shockwave-flash" width="425" height="355" src="http://static.slideshare.net/swf/ssplayer2.swf?doc=javascriptbestpractices-1234957342527920-2&amp;stripped_title=javascript-best-practices-1041724" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
<div style="font-size: 11px; font-family: tahoma,arial; height: 26px; padding-top: 2px;">View more <a style="text-decoration:underline;" href="http://www.slideshare.net/">presentations</a> from <a style="text-decoration:underline;" href="http://www.slideshare.net/cheilmann">Christian Heilmann</a>. (tags: <a style="text-decoration:underline;" href="http://slideshare.net/tag/webdevtrick">webdevtrick</a> <a style="text-decoration:underline;" href="http://slideshare.net/tag/tips">tips</a>)</div>
</div>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.amityadav.name%2Fjavascript-best-practices%2F&amp;title=Javascript%20Best%20Practices" id="wpa2a_22"><img src="http://www.amityadav.name/wp-content/plugins/add-to-any/share_save_171_16.gif" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.amityadav.name/javascript-best-practices/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Various JavaScript library</title>
		<link>http://www.amityadav.name/various-javascript-library/</link>
		<comments>http://www.amityadav.name/various-javascript-library/#comments</comments>
		<pubDate>Thu, 23 Oct 2008 09:45:10 +0000</pubDate>
		<dc:creator>Amit</dc:creator>
				<category><![CDATA[Javascript]]></category>

		<guid isPermaLink="false">http://www.amityadav.name/?p=74</guid>
		<description><![CDATA[JavaScript Backbase CJAX Clean AJAX Dojo Toolkit Echo Ext Gecco Himle JAK (JavaScript API Kernel) JQuery Microsoft AJAX Library midori Mochikit MooTools Morfik, server side and client side. My Library OpenLink AJAX Toolkit Prototype JavaScript Framework qooxdoo Rialto Toolkit Rico Script.aculo.us SmartClient Spry framework VineAjax Yahoo! UI Library Comparison of JavaScript frameworks]]></description>
			<content:encoded><![CDATA[<h3><span class="mw-headline"><a title="JavaScript" href="http://en.wikipedia.org/wiki/JavaScript">JavaScript<br />
</a></span></h3>
<ul>
<li><a title="Backbase" href="http://en.wikipedia.org/wiki/Backbase">Backbase</a></li>
<li><a class="new" title="CJAX (page does not exist)" href="http://en.wikipedia.org/w/index.php?title=CJAX&amp;action=edit&amp;redlink=1">CJAX</a></li>
<li><a title="Clean AJAX" href="http://en.wikipedia.org/wiki/Clean_AJAX">Clean AJAX</a></li>
<li><a title="Dojo Toolkit" href="http://en.wikipedia.org/wiki/Dojo_Toolkit">Dojo Toolkit</a></li>
<li><a title="Echo (framework)" href="http://en.wikipedia.org/wiki/Echo_%28framework%29">Echo</a></li>
<li><a title="Ext (javascript library)" href="http://en.wikipedia.org/wiki/Ext_%28javascript_library%29">Ext</a></li>
<li><a class="new" title="Gecco Toolkit (page does not exist)" href="http://en.wikipedia.org/w/index.php?title=Gecco_Toolkit&amp;action=edit&amp;redlink=1">Gecco</a></li>
<li><a title="Himle" href="http://en.wikipedia.org/wiki/Himle">Himle</a></li>
<li><a class="new" title="JAK (JavaScript API Kernel) (page does not exist)" href="http://en.wikipedia.org/w/index.php?title=JAK_%28JavaScript_API_Kernel%29&amp;action=edit&amp;redlink=1">JAK (JavaScript API Kernel)</a></li>
<li><a title="JQuery" href="http://en.wikipedia.org/wiki/JQuery">JQuery</a></li>
<li><a class="mw-redirect" title="Microsoft AJAX Library" href="http://en.wikipedia.org/wiki/Microsoft_AJAX_Library">Microsoft AJAX Library</a></li>
<li><a title="Midori Javascript Framework" href="http://en.wikipedia.org/wiki/Midori_Javascript_Framework">midori</a></li>
<li><a class="mw-redirect" title="Mochikit" href="http://en.wikipedia.org/wiki/Mochikit">Mochikit</a></li>
<li><a title="MooTools" href="http://en.wikipedia.org/wiki/MooTools">MooTools</a></li>
<li><a title="Morfik" href="http://en.wikipedia.org/wiki/Morfik">Morfik</a>, server side and client side.</li>
<li><a class="new" title="My Library (page does not exist)" href="http://en.wikipedia.org/w/index.php?title=My_Library&amp;action=edit&amp;redlink=1">My Library</a></li>
<li><a title="OpenLink AJAX Toolkit" href="http://en.wikipedia.org/wiki/OpenLink_AJAX_Toolkit">OpenLink AJAX Toolkit</a></li>
<li><a title="Prototype JavaScript Framework" href="http://en.wikipedia.org/wiki/Prototype_JavaScript_Framework">Prototype JavaScript Framework</a></li>
<li><a title="Qooxdoo" href="http://en.wikipedia.org/wiki/Qooxdoo">qooxdoo</a></li>
<li><a title="Rialto Toolkit" href="http://en.wikipedia.org/wiki/Rialto_Toolkit">Rialto Toolkit</a></li>
<li><a title="Rico (Ajax)" href="http://en.wikipedia.org/wiki/Rico_%28Ajax%29">Rico</a></li>
<li><a title="Script.aculo.us" href="http://en.wikipedia.org/wiki/Script.aculo.us">Script.aculo.us</a></li>
<li><a title="SmartClient" href="http://en.wikipedia.org/wiki/SmartClient">SmartClient</a></li>
<li><a title="Spry framework" href="http://en.wikipedia.org/wiki/Spry_framework">Spry framework</a></li>
<li><a class="new" title="VineAjax (page does not exist)" href="http://en.wikipedia.org/w/index.php?title=VineAjax&amp;action=edit&amp;redlink=1">VineAjax</a></li>
<li><a title="Yahoo! UI Library" href="http://en.wikipedia.org/wiki/Yahoo%21_UI_Library">Yahoo! UI Library</a></li>
<li><a title="Comparison of JavaScript frameworks" href="http://en.wikipedia.org/wiki/Comparison_of_JavaScript_frameworks">Comparison of JavaScript frameworks</a></li>
</ul>
<div class="zemanta-pixie" style="margin-top: 10px; height: 15px;"><a class="zemanta-pixie-a" title="Zemified by Zemanta" href="http://reblog.zemanta.com/zemified/d37b58ba-68a8-42a2-97c7-628782f9983b/"><img class="zemanta-pixie-img" style="border: medium none; float: right;" src="http://img.zemanta.com/reblog_e.png?x-id=d37b58ba-68a8-42a2-97c7-628782f9983b" alt="Reblog this post [with Zemanta]" /></a></div>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.amityadav.name%2Fvarious-javascript-library%2F&amp;title=Various%20JavaScript%20library" id="wpa2a_24"><img src="http://www.amityadav.name/wp-content/plugins/add-to-any/share_save_171_16.gif" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.amityadav.name/various-javascript-library/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>14kb Javascript Super Mario, Amazing</title>
		<link>http://www.amityadav.name/14kb-javascript-super-mario-amazing/</link>
		<comments>http://www.amityadav.name/14kb-javascript-super-mario-amazing/#comments</comments>
		<pubDate>Thu, 10 Apr 2008 09:50:53 +0000</pubDate>
		<dc:creator>Amit</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[mario]]></category>

		<guid isPermaLink="false">http://www.amityadav.name/14kb-javascript-super-mario-amazing/</guid>
		<description><![CDATA[Jacob Seidelin worked on an experiment in keepings things small and confined to one Javascript file and came out with a POC of Super Mario. There are no external image files or anything, everything is rendered with Javascript using either canvas elements or old fashioned div-making tactics (for IE). The sprites are stored in custom [...]]]></description>
			<content:encoded><![CDATA[<p align="justify"><a href="http://bp3.blogger.com/_OjchJpvqFiw/R_usewJzl3I/AAAAAAAAADE/_Z2bHuZlwyU/s1600-h/mario.png" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"><img src="http://bp3.blogger.com/_OjchJpvqFiw/R_usewJzl3I/AAAAAAAAADE/_Z2bHuZlwyU/s200/mario.png" style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer" id="BLOGGER_PHOTO_ID_5186929040169342834" border="0" /></a>Jacob Seidelin worked on an experiment in keepings things small and confined to one Javascript file and came out with a POC of Super Mario. There are no external image files or anything, everything is rendered with Javascript using either canvas elements or old fashioned div-making tactics (for IE). The sprites are stored in custom encoded strings in a format that only allows 4 colors for each sprite but in turn only takes up around 40-60 bytes per sprite.</p>
<div align="justify"></div>
<p align="justify">It is by no means a complete clone or anything, it&#8217;s not even an entire level and several key things are missing, such as mushrooms, Koopas and stuff.</p>
<div align="justify"></div>
<p align="justify">Be sure to click the mouse on the game if Mario won&#8217;t move. When you die, you have to reload the page to start over. And yes, you can move left. Sorry.</p>
<div align="justify"></div>
<p align="justify">Regular version: <a href="http://www.nihilogic.dk/labs/mario/mario_small_nomusic.htm" target="_blank">no music</a> or <a href="http://www.nihilogic.dk/labs/mario/mario_small_music.htm" target="_blank">with music</a></p>
<div align="justify"></div>
<p align="justify">Double size: <a href="http://www.nihilogic.dk/labs/mario/mario_large_nomusic.htm" target="_blank">no music</a> or <a href="http://www.nihilogic.dk/labs/mario/mario_large_music.htm" target="_blank">with music</a></p>
<div align="justify"></div>
<p align="justify">The script has been <a href="http://www.nihilogic.dk/labs/mario/mario_compressed.js">compressed</a> to 14kb with the <a href="http://www.julienlecomte.net/yuicompressor/">YUI compressor</a>.<br />
Here&#8217;s the <a href="http://www.nihilogic.dk/labs/mario/mario.js">uncompressed script</a> (35kb), if anyone is interested. The structure may look a bit weird, a lot things have been moved around to get better compression.</p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.amityadav.name%2F14kb-javascript-super-mario-amazing%2F&amp;title=14kb%20Javascript%20Super%20Mario%2C%20Amazing" id="wpa2a_26"><img src="http://www.amityadav.name/wp-content/plugins/add-to-any/share_save_171_16.gif" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.amityadav.name/14kb-javascript-super-mario-amazing/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Parse JSON with jQuery and JavaScript</title>
		<link>http://www.amityadav.name/parse-json-with-jquery-and-javascript/</link>
		<comments>http://www.amityadav.name/parse-json-with-jquery-and-javascript/#comments</comments>
		<pubDate>Wed, 02 Apr 2008 05:54:30 +0000</pubDate>
		<dc:creator>Amit</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[JQuery]]></category>
		<category><![CDATA[JSON]]></category>

		<guid isPermaLink="false">http://www.amityadav.name/?p=6</guid>
		<description><![CDATA[Believe me that the javascript libraries available for user have helped speed up the work to great extent, and they are browser independent. Every time i wrote a javascript code i have to check whether its working on different browsers or not, but thses libraries came and saved me from doing all those difficult work. [...]]]></description>
			<content:encoded><![CDATA[<p>Believe me that the javascript libraries available for user have helped speed up the work to great extent, and they are browser independent.</p>
<p>Every time i wrote a javascript code i have to check whether its working on different browsers or not, but thses libraries came and saved me from doing all those difficult work.</p>
<p>Here i had a requirement of parsing a JSON with jQuery for my project, i had no idea whatsoever about doing this, but ultimately <a title="Parse JSON with jQuery" href="http://blog.reindel.com/2007/10/02/parse-json-with-jquery-and-javascript/" target="_blank">this</a> article saved me, i really thank him for the code. Here i will tell you people how to do that.</p>
<p>Here is the JSON object that we will be parsing.</p>

<div class="wp_codebox_msgheader wp_codebox_hide"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p6code6'); return false;">View Code</a> SCRIPT</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p66"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
</pre></td><td class="code" id="p6code6"><pre class="script" style="font-family:monospace;">{attributes:[{title: &quot;Project Delivered&quot;, post_id: 31, post_type_id: 5, parent_post_id: null, description: &quot;Working&quot;, time_zone: &quot;International Date Line West&quot;, user_id: 4, image_path: &quot;http://localhost:3000/user/image_path/4/thumb/3.jpg&quot;, user_name: &quot;TestUser1&quot;, created_at: &quot;Thu Mar 27 04:29:33 UTC 2008&quot;, email: &quot;testuser1@testurl.com&quot;},{title: &quot;Task Response&quot;, post_id: 45, post_type_id: 6, parent_post_id: null, description: &quot;completed&quot;, time_zone: &quot;International Date Line West&quot;, user_id: 3, image_path: &quot;http://localhost:3000/user/image_path/3/thumb/2.jpg&quot;, user_name: &quot;TestUser2&quot;, created_at: &quot;Fri Mar 28 06:13:49 UTC 2008&quot;, email: &quot;testuser2@testurl.com&quot;},{title: &quot;abhijats post&quot;, post_id: 58, post_type_id: 1, parent_post_id: 55, description: &quot;&quot;, time_zone: &quot;International Date Line West&quot;, user_id: 2, image_path: &quot;http://localhost:3000/user/image_path/2/thumb/9.jpg&quot;, user_name: &quot;TestUser3&quot;, created_at: &quot;Fri Mar 28 11:37:16 UTC 2008&quot;, email: &quot;testuser3@testurl.com&quot;},{title: &quot;Give demo&quot;, post_id: 41, post_type_id: 4, parent_post_id: null, description: &quot;\074strong\076Give demo\074/strong\076&quot;, time_zone: &quot;Paris&quot;, user_id: 1, image_path: &quot;http://localhost:3000/user/image_path/1/thumb/mazewallpaperv2.jpg&quot;, user_name: &quot;TestUser4&quot;, created_at: &quot;Fri Mar 28 06:04:02 UTC 2008&quot;, email: &quot;testuser4@testurl.com&quot;},{title: &quot;Status Update&quot;, post_id: 37, post_type_id: 5, parent_post_id: null, description: &quot;Working&quot;, time_zone: &quot;Paris&quot;, user_id: 1, image_path: &quot;http://localhost:3000/user/image_path/1/thumb/mazewallpaperv2.jpg&quot;, user_name: &quot;TestUser4&quot;, created_at: &quot;Fri Mar 28 05:20:37 UTC 2008&quot;, email: &quot;testuser4@testurl.com&quot;},
&nbsp;
{title: &quot;abhijat has read acess&quot;, post_id: 57, post_type_id: 1, parent_post_id: 55, description: &quot;&quot;, time_zone: &quot;Paris&quot;, user_id: 1, image_path: &quot;http://localhost:3000/user/image_path/1/thumb/mazewallpaperv2.jpg&quot;, user_name: &quot;AbhilashKumar&quot;, created_at: &quot;Fri Mar 28 11:16:50 UTC 2008&quot;, email: &quot;testuser4@testurl.com&quot;},
&nbsp;
{title: &quot;Inxero&quot;, post_id: 48, post_type_id: 2, parent_post_id: null, description: &quot;Inxero&quot;, time_zone: &quot;Paris&quot;, user_id: 1, image_path: &quot;http://localhost:3000/user/image_path/1/thumb/mazewallpaperv2.jpg&quot;, user_name: &quot;TestUser4&quot;, created_at: &quot;Fri Mar 28 06:56:28 UTC 2008&quot;, email: &quot;testuser4@testurl.com&quot;},
&nbsp;
{title: &quot;New public porjet&quot;, post_id: 50, post_type_id: 2, parent_post_id: null, description: &quot;&quot;, time_zone: &quot;Paris&quot;, user_id: 1, image_path: &quot;http://localhost:3000/user/image_path/1/thumb/mazewallpaperv2.jpg&quot;, user_name: &quot;TestUser4&quot;, created_at: &quot;Fri Mar 28 10:30:04 UTC 2008&quot;, email: &quot;testuser4@testurl.com&quot;},
&nbsp;
{title: &quot;Status Update&quot;, post_id: 35, post_type_id: 5, parent_post_id: null, description: &quot;Hey the stuff is coming good&quot;, time_zone: &quot;Paris&quot;, user_id: 1, image_path: &quot;http://localhost:3000/user/image_path/1/thumb/mazewallpaperv2.jpg&quot;, user_name: &quot;TestUser4&quot;, created_at: &quot;Fri Mar 28 01:50:48 UTC 2008&quot;, email: &quot;testuser4@testurl.com&quot;},
&nbsp;
{title: &quot;Status Update&quot;, post_id: 36, post_type_id: 5, parent_post_id: null, description: &quot;kljklkl&quot;, time_zone: &quot;Paris&quot;, user_id: 1, image_path: &quot;http://localhost:3000/user/image_path/1/thumb/mazewallpaperv2.jpg&quot;, user_name: &quot;TestUser4&quot;, created_at: &quot;Fri Mar 28 01:59:08 UTC 2008&quot;, email: &quot;testuser4@testurl.com&quot;}]}</pre></td></tr></table></div>

<p>Here is the JSON parser that will parse the JSON object. <em><br />
this parser uses $.getJSON()</em> method, with a call to the JSON object file, and a function to pass the data through for parsing.The common <em>$.each()</em> method in jQuery can be used to traverse the &#8220;nodes&#8221; (keys) that you indicate.</p>

<div class="wp_codebox_msgheader wp_codebox_hide"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p6code7'); return false;">View Code</a> SCRIPT</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p67"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
</pre></td><td class="code" id="p6code7"><pre class="script" style="font-family:monospace;">$(function(url) {
	$.getJSON(&quot;jsonObj.js&quot;, function(json) {
&nbsp;
		/* Parse JSON objects */
		jJSON[&quot;title&quot;] = (function() {
			response = {
				values: [],
				count: 0
			};
			$.each(json.attributes,function(i,item) {
				if (item.title != &quot;undefined&quot; &amp;amp;&amp;amp; item.title != &quot;&quot;) {
					response.count++;
					response.values[i] = item.title;
				}
			});
			return response;
		})();
&nbsp;
		jJSON[&quot;email&quot;] = (function() {
			response = {
				values: [],
				count: 0
			};
			$.each(json.attributes,function(i,item) {
				if (item.email != &quot;undefined&quot;) {
					response.count++;
					response.values[i] = item.email;
				}
			});
			return response;
		})();
&nbsp;
		jJSON[&quot;created_at&quot;] = (function() {
			response = {
				values: [],
				count: 0
			};
			$.each(json.attributes,function(i,item) {
				if (item.created_at != &quot;undefined&quot;) {
					response.count++;
					response.values[i] = item.created_at;
				}
			});
			return response;
		})();
&nbsp;
		jJSON[&quot;image_path&quot;] = (function() {
			response = {
				values: [],
				count: 0
			};
			$.each(json.attributes,function(i,item) {
				if (item.image_path != &quot;undefined&quot;) {
					response.count++;
					response.values[i] = item.image_path;
				}
			});
			return response;
		})();
&nbsp;
		jJSON[&quot;project_name&quot;] = (function() {
			response = {
				values: [],
				count: 0
			};
			$.each(json.attributes,function(i,item) {
				if (item.image_path != &quot;undefined&quot;) {
					response.count++;
					response.values[i] = item.project_name;
				}
			});
			return response;
		})();
&nbsp;
		/* Function to show data sreams */
&nbsp;
		displaySocialStream = function() {
			var displayDiv = $('#post_wrapper');
			var dumpP;
			var str = '';
			for(strmCntr =0; strmCntr &lt; (jJSON[&quot;title&quot;][&quot;values&quot;].length - 1); strmCntr++){
				if(strmCntr/2 == 0)
				{
					postClass = &quot;post&quot;;
				}else{
					postClass = &quot;post alternate-post&quot;;
				}
&nbsp;
				str = str + '&lt;div class=&quot;' + postClass + '&quot;&gt;&lt;div class=&quot;avatar&quot;&gt;&lt;img src=&quot;' + jJSON[&quot;image_path&quot;][&quot;values&quot;][strmCntr]  + '&quot; class=&quot;avatar-image&quot;/&gt;&lt;/div&gt;&lt;div class=&quot;post-content&quot;&gt;&lt;b&gt;Created At:&lt;/b&gt; ' + jJSON[&quot;created_at&quot;][&quot;values&quot;][strmCntr] + '&lt;br /&gt; &lt;b&gt;Project Name:&lt;/b&gt;' + jJSON[&quot;project_name&quot;][&quot;values&quot;][strmCntr]  + '&lt;br /&gt; &lt;b&gt;Post Title:&lt;/b&gt; ' + jJSON[&quot;title&quot;][&quot;values&quot;][strmCntr]  + '&lt;br /&gt; &lt;b&gt;Email:&lt;/b&gt; &lt;a href=&quot;mailto:' + jJSON[&quot;email&quot;][&quot;values&quot;][strmCntr]  + '&quot;&gt;' + jJSON[&quot;email&quot;][&quot;values&quot;][strmCntr]  + '&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;';
			}
			displayDiv.prepend(str);
		};
		displaySocialStream();
&nbsp;
	});
}
)</pre></td></tr></table></div>

<p>At first glance it seems I could have refined each reference to a self-invoking function into a single function call. However, you must consider that grabbing data from XML is quite different than grabbing data from JSON. While there is still a parent/child relationship, a child in JSON could be a different type, like an array. There might be several arrays throughout the structure. Simply using the dot operator becomes impossible, and getting different keys can be a unique process.</p>
<p>Each key in jJSON references another hash object with two keys, called values and count. Accessing values will return an array of values, and count will tell you how many of that particular reference exists. For example, how many &#8220;title&#8221;or &#8220;email&#8221; key references were obtained from the JSON.</p>

<div class="wp_codebox_msgheader wp_codebox_hide"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p6code8'); return false;">View Code</a> SCRIPT</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p68"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
</pre></td><td class="code" id="p6code8"><pre class="script" style="font-family:monospace;">var jJSON = {
    getValues: function(obj,num) {
        return jJSON[obj][&quot;values&quot;].slice(0,((num == null) ? jJSON[obj][&quot;values&quot;].length : num));
    },
    getCount: function(obj) {
        return jJSON[obj][&quot;count&quot;];
    },
    getRandomValues: function(obj,num) {
        var a = [];
        var b = jJSON[obj][&quot;values&quot;];
        var c = b.length;
        if (num != null &amp;&amp; num &amp;lt; c) {
            c = num;
        }
        for (i = 0; i &lt; c; i++) {
            var e = Math.floor(Math.random() * b.length);
            a[i] = b[e];
            b.splice(e,1);
        }
        return a;
    }
};</pre></td></tr></table></div>

<p>Along with the key references added to the jJSON object, there are three helper methods. The getValues method will return a number of values for a given object key as an array. If you pass in null as the second parameter, you will receive all values. The getCount method will return a count for a given object key. Finally, the getRandomValues will return a number of randomized values for a given object key.</p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.amityadav.name%2Fparse-json-with-jquery-and-javascript%2F&amp;title=Parse%20JSON%20with%20jQuery%20and%20JavaScript" id="wpa2a_28"><img src="http://www.amityadav.name/wp-content/plugins/add-to-any/share_save_171_16.gif" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.amityadav.name/parse-json-with-jquery-and-javascript/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
	</channel>
</rss>

