Monthly Archives: June 2009

Toolkit vs Framework (and AJAX)

Toolkit vs Framework:
If you go through some websites which talk about frameworks and toolkits, especially in AJAx context, you will feel the term framework and toolkit has been used interchangeably. Though just by looking at the two terms we can make out the difference, a toolkit is something which will provide you with some tools or methods which will help you achieve your goal, whereas a framework is something that provides you a way in which the application should be created. But when it comes to AJAX, there is not much difference as the same thing can do both these work. Moreover at times you will also find the usage of term library, which is actually just a collection of methods. A toolkit would be a collection of these libraries, but again sometimes we might just have one library in the toolkit.

Hidden Firefox feature?

I have been using the FF browser for like last 5 years, but this is the first time I observed this feature, that too accidentally. If you double click on the empty space on the bar next to your browser tabs, a new tab opens up.

There is no indication anywhere that a double click will open up a new blank tab. That is one kool thing I found in IE browser, that small box next to your last browser tab, which very clearly tells you “click me! I will open up a new tab”.

I guess that is what we call usability.

AJAX: is it Asynchronous JavaScript and XML?

Recently one of friends asked me how to learn AJAX? Is it all about JavaScript and XML and sending asynchronous data? Though the term AJAX stand for Asynchronous JavaScript and XML. That means the term talks about how to asynchronously retrieve data from server using JavaScript and XML, but actually, AJAX goes much beyond that. It is more about providing a rich experience to users. A rich user experience can be simply stated as a ‘desktop application like feel’; now, desktop applications can have the luxury of heavy weight rich User Interfaces and with AJAX the same is possible for web applications, which so far could afford only a basic UI. With AJAX, the need for reloading the UI again and again with every request is gone; we will understand this more in rest of the document.

AJAX in itself is not a language or a framework. It is a technique. It basically uses XMLHTTPRequest Object to fetch the data from server without reloading the page. Additional AJAX supporters are CSS, DOM, DHTML and XSL.

Another keyword you will observe is Asynchronous. Asynchronous communication in general terms means that a browser does not wait for a reply from server once a request is sent. Hence, it does not stop user from interacting with the page while the information is being fetched from server. The data is retrieved as a back ground process and the web page does not get refreshed, the data is displayed dynamically at runtime giving the web application a feel of desktop application and hence improves user experience.

You might question if AJAX is more than just JavaScript and XML, why is it called AJAX? This is what Jesse James Garrett, the man who coined the term AJAX has to say about it “I needed something shorter than ‘Asynchronous JavaScript + CSS + DOM + XMLHttpRequest’ to use when discussing this approach with clients.” hence the term AJAX

Twenty 20 world cup: The game is on!

Just a couple of days and you can already feel the sensation. West indies beating mighty Australians, Netherlands upsetting England, Scotland giving a target of 90 in 7 over, which was achieved by New Zealand in 6 over scored at a run rate of 15, things are really happening in England.

This really is anybody’s game. You just need a couple of good overs or just one batman gets going and the game is yours. It is different from other versions of cricket. Unlike 50 over game, where maybe first 15 and last 10 overs are the most important, here you only get 20 overs. That means each and ever over counts, or should I say every ball counts. One sloppy shot, one dropped catch, one loose ball; everything is capable of making “the difference”. The rule is simple, go there, and hit it hard, as hard as you can.

Whoever wins, next 15 days would be full of excitement.

keep a track: http://www.cricinfo.com/wt202009/engine/series/335113.html

Difference between visibility hidden vs display none

I spent almost an entire day on this, so wanted to share the information in case it might be helpful for others. We at times need to remove a DOM object (textbox/ label/ dropdown etc) from the UI. For which we use two things object.style.visibility=”hidden” and object.style.display=”none”. Though both of them can remove the object from UI, yet there is a significant difference between these two approaches. Whereas visibility hidden will “hide” the object, it will still leave the object on the UI (in hidden format). On the other hand display=”none” will completely remove the object from UI.

The differentiation is more important in a case, where the css being used here does not specify the x and y coordinates for DOM objects, it instead places one object after another. So the trick here is, if I make an object invisible by hiding it (visibility=”hidden”), it will still occupy that one space in the flow, and a blank cell will appear on the screen. Whereas if display is none, then the next object will take place of this object and hence no empty spaces are shown on the screen.

So both the approaches can be used as per ones requirement