September 28, 2004

The Royal Bank of Scotland write bad JavaScript

I really dislike popup windows, but there are badly designed popup windows and very badly designed popup windows. The latest incompetent company is the Royal Bank of Scotland. At first I couldn't work out why the popup wasn't working, the window opened, then it closed. This was strange, Firefox doesn't close windows after they are opened, it stops them being opened in the first place, and the domain was allowed to open windows in the Firefox preferences.

This is what was really happening:

  1. The user would click on a link
  2. This would open a popup which Firefox allowed as it was opened by a user action
  3. The popup window loaded a document
  4. This document triggered some JavaScript which opened another popup window which Firefox blocked as it was not opened by a user action
  5. The JavaScript in the document then closed the popup window

This left the user right back where they started.

"Why did the second popup window get blocked?", I hear you ask, "After all, the domain was allowed to open popups!"

Cunningly, the RBS decided that the document containing the "Open new window, close existing window" code should be on a different domain to that which the user started on. So while rbs.co.uk was allowed to open popups, rbsdigital.com was not - and got blocked.

Why do so many banks insist on using popup windows for their online banking anyway? I would rather like to be able to have a full screen window to look at my statement in… so much so that I make it a point to resize my popups!

Posted at September 28, 2004 07:50 PM (TrackBack)