Archive for May, 2009

Firefox: Updates configuration

May 18, 2009 Leave a comment

Why does the Fire fox browser do the updates only when you start the browser? This is weird and it irritates me. When you want to do some quick check using Internet, you double-click the Fire fox icon on your desktop (or wherever) and now at this time, Fire fox displays a message saying, Fire fox is doing an update and the browser will be loaded after this. Heck! And you have to wait patiently until Fire fox finishes its update and its compatibility checking for the extensions. This is an irritating behavior with Fire fox.
However, this can be configured using the settings. See here. At least, now after the changes in the Update Configuration, Fire fox consults the user before doing anything on its own.

What do you like: automatic updates or asking the user?

Categories: Browser, Firefox Tags:

Do you want to close this window?

May 15, 2009 1 comment

Sometimes you would want to close the window programatically using javascript:

There is a joke, I recall now, about Microsoft. A guy used a car and that car’s software was controlled by Microsoft Windows CR. One day that guy got frustrated at his work because of some stupid bug and was outrageously driving his car at top speed. Eventually his car became uncontrolable and he was about to bump in to the truck that was going before him. His cars air-bag was supposed to open now. Now the Microsoft Windows CR asked that guy a very smart question: Do you really want to open the air-bag? BANG!

Now, back to our problem: When you try to close an existing window programatically using javascript windows will behave very smart by asking the user: The web page you are viewing is trying to close the window. Do you want to close this window?

Now functinally,this window is supposed to be closed and user does not want to see this smart question asked by windows OS. What would you do?

Using the below code would not bring up that message:

function closeWithOutconfirm()
self.opener = this;

Catch Window Close Event

May 15, 2009 8 comments

Once in a while people ask me how to catch the IE window’s close event. One thing to use is onbeforeunload event of the window. But the problem in using this event is, you never know when this onbeforeunload event is called. This event could be called for numerous reason like navigation to another page with in the application. So you cannot exactly catch the browser close event using onbeforeunload.

The mouse pointer position comes in handy in this cases. We can effectively harness the power of both onbeforeunload and clientY position to exactly catch the browser close event.


window.onbeforeunload = onunload;
function onunload()
var closeEvent=false;
if (event.clientY < 0)
closeEvent = true;

if ((closeEvent))
//Write your code here for close event.

Is there any other efficient way to do this?


Anonymous: This so very well works with internet explorer 8; i have also tested the tabs it works well. I have given the full code here. However, obviously, there is a requirement: You must allow the execution of javascript.


    window.onbeforeunload = closeit;

    function closeit() {
        var closeEvent = false;
        if (event.clientY < 0)
            closeEvent = true;

        if ((closeEvent)) {
            alert("do you want to close the window");
            //your actions during closing comes here

  <a href="">Click here to navigate to

The above code helps us to catch the window close event and there by we can do what ever we wish to do.

In some cases it is enough to just alert the user that he is trying to close the window; how to achieve it? That is even more simple; just return a string value in the closeit function

function closeit()
  return "Any string value here forces a dialog box to \n" + 
         "appear before closing the window.";

Japan Metro – IT Trends

Today I received an email from my brother about this unusual comparison map. This map compares and maps the Japaan’s Metro line to the most famous IT Trends of this year. See it here.

Categories: Web Tags: ,