reload-mania from British Airways

I've just tried to book a British Airways flight on a mobile phone. This particular phone is a fancy thing with a touch-sensitive screen and on-screen keyboard. One imagines this sort of phone would be bought by natural born high-flying BA customers…

The problem was that as soon as one focuses a text input on the site, for example the departure airport box, the on-screen keyboard appears – and the site goes mad. It reloads. And reloads. And reeeeloaaaaads. Forever. It's like they want you to waste as much of their bandwidth as possible – and they really don't want you to book any flights..

On closer inspection, the same thing happened on desktop when resizing the window. The on-screen keyboard's appearance triggered an onresize JavaScript on the site – here it is with all its logic and glory:

function resizeHandler() {
    if (this.innerWidth != origWidth || this.innerHeight != origHeight) { location.reload(); }
    if (browser_base=="op") { setTimeout('resizeHandler()',500); }

So, first of all if window dimensions have changed, I command you to reload the page (we might be loosing data that the wannabe customer has typed in but hey, they'll probably learn and won't make the mistake of resizing the window again. And if they resize their browser after buying a ticket so that the order is re-submitted – well, we earn more money, don't we?). Secondly, if you happen to be Opera, please do the same thing again 500ms later – reload page and set a new 500ms timeout (why would we be content with one double-booking when we can have one hundred before you get around to closing the window?).

Certainly a candidate for the Museum of Astonishingly Broken JavaScript.


9 thoughts on “reload-mania from British Airways

  1. Originally posted by angry coder:

    Fastest browser in the world, hmm? We'll see if you can load a new page in 500ms or die trying

  2. "(why would we be content with one double-booking when we can have one hundred before you get around to closing the window?)"Heheh, I heard the voice of Dr. Evil when reading that 😀

  3. Scipio: Because the underpants gnomes might have run off with the magic carpet to see the king of the potatoe heads, of course! Don't you know anything?? Sheesh…

  4. scipio: it is a sort of workaround against rendering bugs, particularly in Netscape 4 which must have been crap at resizing anything judged by the popularity of "do weird things on resize if UA is NN4" scripts…

  5. Netscape 4 is indeed the reason. If you resize, it generally forgets half of the CSS, produces less than beautiful overlaps, and makes the site unusable. Why they still feel the need to add special code for a browser as dead as NS4 is a mistery. Smells a lot like copy/paste.As for the Opera part, that part I do not know. Maybe Opera 5 had a bug like that or something, but it's not one I remember.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s