<?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>Bin-Blog &#187; JavaScript</title>
	<atom:link href="http://www.bin-co.com/blog/tag/javascript/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.bin-co.com/blog</link>
	<description>Learn about the latest in Web Development - as soon as I do.</description>
	<lastBuildDate>Tue, 13 Oct 2009 18:55:47 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>JSL &#8211; a New JavaScript Library</title>
		<link>http://www.bin-co.com/blog/2008/07/jsl-javascript-library/</link>
		<comments>http://www.bin-co.com/blog/2008/07/jsl-javascript-library/#comments</comments>
		<pubDate>Sun, 20 Jul 2008 18:17:56 +0000</pubDate>
		<dc:creator>Binny V A</dc:creator>
				<category><![CDATA[Browsers]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[client]]></category>
		<category><![CDATA[framework]]></category>
		<category><![CDATA[jsl]]></category>
		<category><![CDATA[library]]></category>
		<category><![CDATA[script]]></category>

		<guid isPermaLink="false">http://www.bin-co.com/blog/?p=119</guid>
		<description><![CDATA[Yesterday, I published a new JavaScript Library &#8211; JSL. It borrows many ideas from the famous jQuery library. Download Packed Version &#8211; 13 KB Source &#8211; 38 KB Features The Standard Stuff&#8230; CSS DOM Selectors Ajax Functions Event Handling is abstracted Ability to change style of an element. Extendable by Plugins Supports all Modern Browsers [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.bin-co.com/blog/wp-content/uploads/2008/05/javascript_logo.jpg" alt="Javascript Rhino Logo" title="Javascript Logo" width="230" height="194" class="wp-image-109 intro" align="right" /></p>
<p class="intro">Yesterday, I published a new <a href="http://www.openjs.com/scripts/jslibrary/">JavaScript Library &#8211; JSL</a>. It borrows many ideas from the famous  <a href="http://jquery.com/">jQuery</a> library. </p>
<h2>Download</h2>
<ul>
<li><a href="http://www.openjs.com/scripts/jslibrary/releases/jsl.js">Packed Version</a> &#8211; 13 KB</li>
<li><a href="http://www.openjs.com/scripts/jslibrary/releases/jsl-src.js">Source</a> &#8211; 38 KB</li>
</ul>
<h2>Features</h2>
<p>The Standard Stuff&#8230;</p>
<ul>
<li>CSS DOM Selectors</li>
<li>Ajax Functions</li>
<li>Event Handling is abstracted</li>
<li>Ability to change style of an element.</li>
<li>Extendable by Plugins</li>
<li>Supports all Modern Browsers</li>
<li>And more&#8230;</li>
</ul>
<p>And then some&#8230;</p>
<ul>
<li>Function Chainability</li>
<li>Entire Library is 13 KB(un-gzipped)</li>
<li>Special handlers for <a href="http://projects.binnyva.com/wiki/JSL.array">Arrays</a>, <a href="http://projects.binnyva.com/wiki/JSL.number">Numbers</a></li>
<li>Extra Plugins for Unit Testing and Debugging</li>
<li>Functional Programming Encouraged (map, reduce, filter, etc functions in <a href="http://projects.binnyva.com/wiki/JSL.array">JSL.array</a>)</li>
</ul>
<h2>Missing Features</h2>
<dl>
<dt>XPath Selectors</dt>
<dd>Does anyone use XPath to select elements in JavaScript? I use CSS selectors for this all the time.</dd>
<dt>innerHTML Alternatives</dt>
<dd>I like innerHTML &#8211; so I did not include the <a href="http://www.openjs.com/scripts/createdom/">functions to create DOM elements</a>.</dd>
<dt>Animations/UI Elements</dt>
<dd>You will not see any animation functions in this library. Also, no Drag and Drop, sliders, JS dialog boxes and the like. Of course, I may write a plugin for these elements &#8211; but right now, they are not supported.</dd>
<dt>JavaScript Monkey-patching</dt>
<dd>I don&#8217;t do any <a href="http://www.prototypejs.org/">Prototype</a> style addition to JavaScript standard objects. I hate that &#8211; and so should you.</dd>
<dt>Functions in the global namespace</dt>
<dd>Everything that I do is under the JSL namespace &#8211; except for two shortcut functions &#8211; <code>jslib()</code> and <code>$()</code>. So my library adds only three global variables to the namespace &#8211; JSL, jslib, and $.</dd>
<dt>The <a href="http://en.wikipedia.org/wiki/Kitchen_sink_syndrome">Kitchen Sink</a></dt>
<dd>JSL is a small library &#8211; if you want a library with everything, opt for <a href="http://dojotoolkit.org/">Dojo</a> or <a href="http://developer.yahoo.com/yui/">YUI</a>.</dd>
</dl>
<h2>Some Sample Code</h2>
<h4>Using Event Handler&#8230;</h4>
<pre><code class="javascript">JSL.dom("a").click(function(e) { // Adds a click event handler to all links
	alert(this.href); //Shows the link URL
	JSL.event(e).stop(); //And stops the event from propagating any further
});</code></pre>
<h4>The $() Function&#8230;</h4>
<pre><code class="javascript">$("div.content p.intro a").setStyle({
	"text-decoration":"underline",
	"color":"red"
});</code></pre>
<p>And everything you expect to work with document.getElementById() works with $() as well&#8230;</p>
<pre><code class="javascript">$("element-id").innerHTML = "Hello World";
$("element-id").getElementsByTagName("a"); // Returns all the anchors under that element.</code></pre>
<p>See More <a href="http://www.openjs.com/scripts/jslibrary/preview.php">Sample Code</a></p>
<h2>JSL Links</h2>
<ul>
<li><a href="http://projects.binnyva.com/wiki/JSL">Documentation</a></li>
<li><a href="http://www.openjs.com/scripts/jslibrary/demos/">Demos of JSL in Action</a></li>
<li><a href="http://projects.binnyva.com/forum/viewforum.php?f=2">Support Forum</a></li>
<li><a href="http://www.openjs.com/scripts/jslibrary/code/trunk/">Code Repository</a></li>
</ul>
<h2>License</h2>
<p><a href="http://www.openjs.com/license.php">BSD, as always</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bin-co.com/blog/2008/07/jsl-javascript-library/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Hello Script For JavaScript</title>
		<link>http://www.bin-co.com/blog/2008/05/hello-script-for-javascript/</link>
		<comments>http://www.bin-co.com/blog/2008/05/hello-script-for-javascript/#comments</comments>
		<pubDate>Thu, 22 May 2008 18:26:14 +0000</pubDate>
		<dc:creator>Binny V A</dc:creator>
				<category><![CDATA[Browsers]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Scripts]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[hello]]></category>
		<category><![CDATA[script]]></category>

		<guid isPermaLink="false">http://www.bin-co.com/blog/?p=108</guid>
		<description><![CDATA[The next language to get the Hello Script treatment is JavaScript &#8211; my favorite language. Before we go any further, here is the definitions for Hello Script and JavaScript &#8211; just to make sure that we are on the same page&#8230; Hello Script &#8216;Hello Script&#8217; is a file that contains the most commonly used elements [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.bin-co.com/blog/wp-content/uploads/2008/05/javascript_logo.jpg" alt="Javascript Rhino Logo" title="Javascript Logo" width="230" height="194" class="alignnone size-full wp-image-109 intro" align="right" /></p>
<p class="intro">The next language to get the <a href="http://www.bin-co.com/blog/2008/03/learning-a-new-programming-language-the-hello-world-method/">Hello Script</a> treatment is <a href="http://www.openjs.com/">JavaScript &#8211; my favorite language</a>. Before we go any further, here is the definitions for Hello Script and JavaScript &#8211; just to make sure that we are on the same page&#8230;</p>
<dl>
<dt>Hello Script</dt>
<dd><strong class="highlight">&#8216;Hello Script&#8217; is a file that contains the most commonly used elements of a programming language so that it can be used as a cheat sheet</strong> when working with that language.</dd>
<dt><a href="http://localhost/Sites/openjs/openjs.com/about.php#about-js">JavaScript</a></dt>
<dd>JavaScript is a <strong class="highlight">client side scripting language</strong> that is used in browsers.</dd>
</dl>
<h2>Code</h2>
<p>Warning: Do not run this code &#8211; you will get a lot of alerts. If you have firebug extension, uncomment the first line &#8211; then you can run the code.</p>
<pre><code class="html">
&lt;html&gt;
&lt;head&gt;
&lt;title&gt;Hello Script for JS&lt;/title&gt;
&lt;script type="text/javascript"&gt;
//alert=console.log;
alert("Hello World");

// Variables, concatination
var name = 'Binny';
var year = 2008;
alert("Hello, " + name + " - welcome to " + year );

//If,else conditions
if (year &gt; 2008) {
	alert("Welcome to the future - yes, we have flying cars!");
}
else if(year &lt; 2008) {
	alert("The past - please don't change anything. Don't step on any butterflies. And for the sake of all thats good and holy, stay away from your parents!");
}
else {
	alert("Anything wrong with your time machine? You have not gone anywhere, kiddo.");
}

// For loop
for(var i=0; i&lt;3; i++) {
	alert(i + ") Hi there!");
}

//Numerical Array, While
var rules = [
	'Do no harm',
	'Obey',
	'Continue Living'
];
var i = 0;
while(i&lt;rules.length) {
	alert("Rule " + (i+1) + " : " + rules[i]);
	i++;
}

// Associated array, foreach
var associated = {
	'hello'	:	'world',
	'foo'	:	'bar',
	'lorem'	:	'ipsum'
}
for(key in associated) {
	alert(key + " : " + associated[key]);
}

// Using Join and Split
csv_values = "hello,world,how,are,you".split(",");
alert(csv_values.join(":"));

// Function, argument, return, call
function hello(name) {
	return "Hello " + name;
}
hello_string = hello("Binny");
alert(hello_string);

// One for the OOP fanboys - Class, members, object and stuff.
function Movie(name) { //Constuctor
	this.name = name;
}
Movie.prototype.rateMovie = function() {
	this.rating = (this.name.length % 10) + 1; //IMDBs rating algorithm. True story!
}

Movie.prototype.printMovieDetails = function() {
	alert("Movie : " + this.name + "\nRating : " + this.rating);
}

//Create the object
ncfom = new Movie("New Country for Old Men"); //It's a sequel!
ncfom.printMovieDetails();

// Regular Expressions
string = "Hello World";
if(string.match(/^Hell/)) alert("Yup - its evil\n");
alert(string.replace(/l([^l])/g, "$1")); //Remove an 'l' from both words. Should alert('Helo Word'

/**
 * Specialized code
 */
window.onload = function() {
	var ele = document.getElementById("div-element");
	alert(ele);
	ele.innerHTML = "Hello World";
	ele.onclick = function() {
		alert("You Clicked?");
	}

	document.getElementById("text").value = "Goodbye World";
}
&lt;/script&gt;
&lt;/head&gt;
&lt;body&gt;

&lt;div id="div-element"&gt;&lt;/div&gt;

&lt;input type="text" value="3" id="text" /&gt;

&lt;/body&gt;
&lt;/html&gt;
</code></pre>
]]></content:encoded>
			<wfw:commentRss>http://www.bin-co.com/blog/2008/05/hello-script-for-javascript/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Alertle Launched</title>
		<link>http://www.bin-co.com/blog/2008/02/alertle-launched/</link>
		<comments>http://www.bin-co.com/blog/2008/02/alertle-launched/#comments</comments>
		<pubDate>Sun, 10 Feb 2008 18:22:43 +0000</pubDate>
		<dc:creator>Binny V A</dc:creator>
				<category><![CDATA[Events]]></category>
		<category><![CDATA[Personal]]></category>
		<category><![CDATA[Review]]></category>
		<category><![CDATA[Sites]]></category>
		<category><![CDATA[Web 2.0]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[alertle]]></category>
		<category><![CDATA[application]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[reader]]></category>
		<category><![CDATA[rss]]></category>
		<category><![CDATA[web]]></category>
		<category><![CDATA[work]]></category>

		<guid isPermaLink="false">http://www.bin-co.com/blog/2008/02/alertle-launched/</guid>
		<description><![CDATA[I am one of the geeks behind Alertle. Its a web based RSS Reader. I am responsible for a good amount of the JavaScript areas of this app Features Single Page Application The entire application is contained in a single page &#8211; everything is done through Ajax. I will not advice that you make something [...]]]></description>
			<content:encoded><![CDATA[<p><a href='http://www.alertle.com/' title='Alertle Screenshot'><img src='http://www.bin-co.com/blog/wp-content/uploads/2008/02/alertle_screenshot.jpg' alt='Alertle Screenshot' class="intro" align="right" /></a></p>
<p class="intro">I am one of the geeks behind <a href="http://www.alertle.com/">Alertle</a>. Its a web based RSS Reader. I am responsible for a good amount of the JavaScript areas of this app <img src='http://www.bin-co.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<h2>Features</h2>
<dl>
<dt>Single Page Application</dt>
<dd>The entire application is contained in a single page &#8211; everything is done through Ajax. I will not advice that you make something like this(its a maintenance nightmare) but I can say one thing about it &#8211; its Cool. With a capital &#8216;C&#8217;.</dd>
<dt>Keyboard Shortcuts</dt>
<dd>I got the idea of creating a <a href="http://www.openjs.com/scripts/events/keyboard_shortcuts/">Keyboard Shortcut Library for JavaScript</a> when I was working on this feature.</dd>
<dt>Autoplay</dt>
<dd>You can view articles as you are viewing a slideshow if you enable this.</dd>
<dt>Feedpacks</dt>
<dd>You can bunch a group of feeds together into a feedpack &#8211; and see all the posts from such a group together.</dd>
<dt>Sharing</dt>
<dd>You can share your feedpacks with other users</dd>
</dl>
<h3>Perfect for High Volume Feeds</h3>
<p>There is one major feature that sets Alertle appart from other RSS readers &#8211; it does not tell you if a post is read or not. Yeah, first you will think its a missing feature &#8211; but its not. I have used a lot of feed readers &#8211; once you subscribe to a couple of high volume feed &#8211; like say, BoingBoing or Slashdot or something, you can say goodbye to your sanity. It creates so many new items that the only way of staying away the mess is to click on the &#8216;Mark all as read&#8217; button once every four seconds. You know what I mean &#8211; I am sure <a href="http://www.problogger.net/archives/2007/03/01/34-reasons-why-readers-unsubscribe-from-your-blog/">you have unsubscribed from many feeds for this reason.</a></p>
<p>With alertle, you can subscribe all these high volume feeds. And there is no pressure to view all the posts.</p>
<p>If you are an info junkie, I can guaranty that your will get lost for hours in Alertle.</p>
<h2>Problems</h2>
<h3>IE is not Supported</h3>
<p>We are still working on this &#8211; and due to deadline constraints, we decided to release Alertle without IE support. So if you are an IE user, I am sorry &#8211; but What in the World are you Doing? Ditch that terrible browser and get a <a href="http://www.mozilla.com/en-US/firefox/">real browser</a> right now!</p>
<p>If we can get a few people to switch to firefox before we add support for IE, I will say that Alertle gone beyond and above the call of duty to make the web a better place! <img src='http://www.bin-co.com/blog/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
<h3>Posts don&#8217;t have a Read Flag (pun unintended)</h3>
<p>Um., yeah, I know &#8211; this is both an advantage and a disadvantage. This will prevent me from using Alertle for all my feeds. For my must-read feeds, I will still be using Google Reader. For the high volume stuff, I will use Alertle.</p>
<h2>Getting to Know Alertle</h2>
<p>So, what are you waiting for? Head over to Alertle and sign up for an account. Its FREE!</p>
<p>But if you are still unconvinced, here is a demo&#8230;</p>
<p><object width="425" height="355"><param name="movie" value="http://www.youtube.com/v/ztQJ4ec1aWs&amp;rel=1"></param><param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/ztQJ4ec1aWs&amp;rel=1" type="application/x-shockwave-flash" wmode="transparent" width="425" height="355"></embed></object></p>
<h2>Links</h2>
<ul>
<li><a href="http://www.alertle.com/">Alertle</a></li>
<li><a href="http://mashable.com/2008/02/07/alertle/">Masable&#8217;s take on Alertle</a></li>
<li><a href="http://blog.alertle.com/">Alertle Blog</a></li>
<li><a href="http://wiki.alertle.com/">Alertle Docs</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.bin-co.com/blog/2008/02/alertle-launched/feed/</wfw:commentRss>
		<slash:comments>14</slash:comments>
		</item>
		<item>
		<title>Keyboard Shortcuts JavaScript Library</title>
		<link>http://www.bin-co.com/blog/2007/07/keyboard-shortcuts-javascript-library/</link>
		<comments>http://www.bin-co.com/blog/2007/07/keyboard-shortcuts-javascript-library/#comments</comments>
		<pubDate>Sat, 21 Jul 2007 18:29:26 +0000</pubDate>
		<dc:creator>Binny V A</dc:creator>
				<category><![CDATA[Accessibility]]></category>
		<category><![CDATA[Ajax]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Scripts]]></category>
		<category><![CDATA[Web 2.0]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[IIS]]></category>
		<category><![CDATA[keyboard]]></category>
		<category><![CDATA[library]]></category>
		<category><![CDATA[openjs]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[shortcut]]></category>

		<guid isPermaLink="false">http://www.bin-co.com/blog/2007/07/keyboard-shortcuts-javascript-library/</guid>
		<description><![CDATA[I have created the second version of the JavaScript Shortcut Library. It is one of my more popular scripts. This script eases the work involved in making shortcuts in JavaScript. Despite the many JavaScript libraries that are available today, I cannot find one that makes it easy to add keyboard shortcuts(or accelerators) to your javascript [...]]]></description>
			<content:encoded><![CDATA[<p class="intro">I have created the second version of the <a href="http://www.openjs.com/scripts/events/keyboard_shortcuts/">JavaScript Shortcut Library</a>. It is one of my more <a href="http://www.dzone.com/links/handling_keyboard_shortcuts_in_javascript.html">popular</a> <a href="http://ajaxian.com/archives/handling-keyboard-shortcuts-in-javascript">scripts</a>. This script eases the work involved in making shortcuts in JavaScript.</p>
<blockquote><p>Despite the many JavaScript libraries that are available today, I cannot find one that makes it easy to add keyboard shortcuts(or accelerators) to your javascript app. This is because keyboard shortcuts where only used in JavaScript games &#8211; no serious web application used keyboard shortcuts to navigate around its interface. But Google apps like Google Reader and Gmail changed that. So, I have created a function to make adding shortcuts to your application much easier.</p></blockquote>
<h2>Changelog</h2>
<ul>
<li>The single function method was abandoned for an object with two functions</li>
<li>Shortcut Remove function added</li>
<li>New option to disable shortcuts in textarea, input fields.</li>
</ul>
<p>If you are using this script in any of your projects, please switch to the latest version.</p>
<p><a href="http://www.openjs.com/scripts/events/keyboard_shortcuts/v1.php">Previous Version Documentation</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.bin-co.com/blog/2007/07/keyboard-shortcuts-javascript-library/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Success/Error Design Pattern For Ajax</title>
		<link>http://www.bin-co.com/blog/2007/06/successerror-design-pattern-for-ajax/</link>
		<comments>http://www.bin-co.com/blog/2007/06/successerror-design-pattern-for-ajax/#comments</comments>
		<pubDate>Fri, 22 Jun 2007 14:41:13 +0000</pubDate>
		<dc:creator>Binny V A</dc:creator>
				<category><![CDATA[Ajax]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[Design]]></category>
		<category><![CDATA[IIS]]></category>
		<category><![CDATA[pattern]]></category>

		<guid isPermaLink="false">http://www.bin-co.com/blog/2007/06/successerror-design-pattern-for-ajax/</guid>
		<description><![CDATA[&#8216;Success/Error&#8217; design pattern for Ajax requests is a JSON encoded string in a specific format &#8211; each response has a minimum of two elements in it &#8211; ie &#8216;success&#8217; and &#8216;error&#8217; &#8211; like this&#8230; { "success":"Task done successfully", "error":false } OR { "success":false, "error":"Database Connection Error!" } This method is used extensivly in Nexty. Almost [...]]]></description>
			<content:encoded><![CDATA[<p class="intro">&#8216;Success/Error&#8217; design pattern for Ajax requests is a <abbr title="JavaScript Object Notation">JSON</abbr> encoded string in a specific format &#8211; each response has a minimum of two elements in it &#8211; ie &#8216;success&#8217; and &#8216;error&#8217; &#8211; like this&#8230;</p>
<pre><code class="javascript">{
"success":"Task done successfully",
"error":false
}</code></pre>
<p>OR</p>
<pre><code class="javascript">{
"success":false,
"error":"Database Connection Error!"
}</code></pre>
<p>This method is used extensivly in <a href="http://www.bin-co.com/blog/2007/05/what-i-learned-from-nexty/">Nexty</a>. Almost all Ajax response in Nexty ares in this format.</p>
<p>Since this is in the JavaScript domain, I thougt it might be better to pubish the details in my <a href="http://www.openjs.com/">OpenJS site</a>. Read more about <a href="http://www.openjs.com/articles/ajax/success_error_design_pattern.php">Success/Error Design Pattern For Ajax</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bin-co.com/blog/2007/06/successerror-design-pattern-for-ajax/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
