Articles

A Code Study of the Mikeyy Twitter Worm
I am an active twitter user - and when I saw that many twitter profiles have been affected by the Mikeyy worm, I wanted to take a look at the code behind the worm. This post will help you understand the basic working of the worm.
Firebug: Javascript Development Made Easier, a Presentation
Couple of weeks ago, I gave a presentation on Firebug at Barcamp Kerala 3. It was titled 'Firebug: Javascript Development Made Easier'. Its an introduction to firebug and how to use it for CSS Designing and JavaScript Development.
Ajax File Upload Response Handling
A while ago, I wrote an article on <a href="http://www.openjs.com/articles/ajax/ajax_file_upload/">Ajax File Upload</a> - the method of uploading a file without refreshing the page using a hidden iframe. Since then people wanted to know how to get information about the file back into the javascript application. Consider this the second part of that article - this post will tell you how to get the information about the uploaded file in javascript.
Ajax 'Loading Indicator' Design Pattern
Almost all Ajax apps shows a small loading indicator(usually a small rotating gif image) when they are sending or receiving data from the server. It is not there for decoration - it makes the application faster in the eyes of the user. Its not real speed - its a 'perceived speed' - an assurance to the user that something is happening behind the scenes.
Hide the Target URL of a Link in Status Bar
There are some instances where you have redirect the user through one page to get them to another page. There is a way to do this stealthily - without letting the user know that there was a redirect. Yes - it sounds evil - but it don't have to be. Say you have a click tracking software - you have to track each click the users make. To do that you need a redirecting page what will track the clicks.
My JavaScript Presentation at BarCamp
I did a session on the power of JavaScript at our local BarCamp. The session was titled 'JavaScript: the most underestimated, undervalued and misunderstood language'.
JavaScript as a Scripting Language
JavaScript is an impressive language. Unfortunately, today its power is limited to the browser. That's the only area where JavaScript is used seriously. Fortunately, this trend is changing. We are beginning to see serious server side javascript implementations - like Rhino on Rails.
Make Firefox Twice as Fast and Much More Stable Easily
A must have extension for all javascript programmers is Firebug. It is my favorite extension in firefox - bar none. I cannot imagine how I managed to work on JavaScript before Firebug. But all this power comes at a price - it is slow. It causes the entire firefox application to be much slower - and sometimes even unstable. Inspite of all these shortcomings, uninstalling Firebug is not an option. A better way of making firefox faster is to create two profiles - one for browsing and another for development.
Ajax Data Transfer Methods - XMLHttpRequest Alternatives
XMLHttpRequest is not the only way to implement Ajax - in fact it is not even the most popular one. Take a quick look at the various transport methods in Ajax...
Short Circuit Operators in JavaScript
The && and || operators are called short-circuit operators. They will return the value of the second operand based on the value of the first operand.
Ajax Response Data Formats
Some time ago, <a href="http://www.quirksmode.org" class="external">Peter Paul Kosh</a> wrote an article about the different types of Ajax data formats - <a href="http://www.quirksmode.org/blog/archives/2005/12/the_ajax_respon.html" class="external">The AJAX response: XML, HTML, or JSON?</a>. The response format is the format in which the data is sent from the Server side to the client side. There is another format to send data from the client side to the server side - <a href="http://www.openjs.com/scripts/data/ued_url_encoded_data/">UED(Url Encoded Data)</a>.
Semicolon Insertion
Semicolon insertion refers to the ability of JavaScript to insert semicolons between statements that are separated by a new line. This feature is something that must be in the back of your mind when working on javascript.
License
All scripts, codes and programs are in the BSD License. That means that you can do anything with the scripts - except claim that you wrote it. You can use, copy, sell, modify or whatever you want with it - but you cannot claim authorship.
Success/Error Design Pattern For Ajax
'Success/error' design pattern for Ajax requests is a JSON encoded string in a specific format - each response has a minimum of two elements in it - ie 'success' and 'error' - like this...
Session Timeout Error in Ajax Applications
I recently discovered a major issue in many of my(and others) Ajax apps - not handling Session timeout properly. Lets say that you are using PHP as the backend. It has a 20 minute time limit for sessions(by default). If the user does not make any requests in that time, the session will get timed out. In normal, web 1.0, non-ajax applications, this is not a problem. If the session variable is not set, the code will do a redirect to the login page. But in Ajax applications, this becomes a problem.
Ajax File Upload
You might have seen Ajax File Uploading in some sites. The basic idea is to upload a file without refreshing the page. Some sites go even further by providing details on how much percentage is uploaded, etc. It is very easy to achieve this effect using javascript.
New JavaScript Updates in Firefox 3
John Resig has written an article outlining the updates to JavaScript in the latest version of Firefox - Firefox 3. This version is still in Alpha stage. The major points are...
Last Comma in Object/Array Issue in IE
One super weird issue in IE is the way it handles the final comma in an array/object initialization - it simply ignores all the code from there. This bit of code will illustrate what I am trying to say...
Delete operator in JavaScript
One of the lesser known operators in JavaScript is the 'delete' operator. I came to know about this operator when I was searching for a way to delete an element of an associative array.
AHAH(Asynchronous HTML over HTTP)
AHAH or <em>Asynchronous HTML over HTTP</em> is a much simpler version of <acronym title="AJAX : Asynchronous JavaScript and XML"><a href="http://en.wikipedia.com/wiki/AJAX">AJAX</a></acronym>. Using AHAH approach in JavaScript you can display external XHTML pages inside your HTML page. The beauty of the script is that it is very simple - the underling code is just twenty lines!
JavaScript and Performance Optimization
How badly do we need optimization in javascript? On one hand javascript is a perfect model for distributed execution - and on the other hand, javascript is very slow(especially on some browsers). Use optimized code only if there is a visible increase in speed - else discard it for the more readable version.
DOMTool
DOMTool is a script that will create the W3C DOM statements using the HTML that is given as the input.
For Loop in JavaScript
For loops are the most used loops in any language. But there is more than one way to iterate using a for loop. These are the ways you can use the for loop in JavaScript. The advantages and disadvantages are given too.
Optional Function Arguments in JavaScript
Many programming languages support optional function arguments - ie. functions in which certain arguments are optional. You can set a default value for any argument - so if the argument is not present, the default value will be used. Unfortunately, JavaScript is not one of these languages - so we will have to use a bit of trickery to get this effect in JavaScript.
JavaScript Detection using CSS
This is a method to see wether JavaScript is enabled using CSS. This works by giving a id(or class) to the body tag with JavaScript. With this we can set CSS rules that will only apply if javascript is enabled.
Using POST method in XMLHTTPRequest(Ajax)
Shows how to use POST method when creating an Ajax Script.
Prevent the Default Action for an Event
There are many occasions when you have to override the default action of an event - a detailed analysis of the different methods to do this.

Tutorials

ABC of JavaScript : An Interactive JavaScript Tutorial
An Interactive tutorial for javascript or JScript language. Teaches how to program and code JavaScript scripts and how to embed the scripts in HTML for websites. This tutor is aimed at beginners of the language.
Advanced JavaScript Tutorial
A tutorial for javascript scripting language. Teaches how to develop and code JavaScript scripts and how to embed the scripts in HTML for websites.
A Gentle Introduction to Ajax
Ajax or Asynchronous JavaScript and XML enables the programmer to execute a server-side script without refreshing the page. A tutorial that introduces the user to the basics of this new technology.