Today we'll have a backstage look at the coding of one of the most important sites out there: they don't come much bigger than MSN Hotmail..
Their junkmail "Block sender" settings screen does not work in Opera. You can add addresses but not submit the final result to actually save the setting, because clicking the "OK" button seems to do nothing.
There are two subtle differences in the code sent to IE and the code sent to Opera.
Firstly, IE gets this code for the OK button:
<input type="submit" class="A" name="OK.x" value=" OK ">
while Opera gets
<input type="button" class="A" onClick="return buildAllLists();" name="OK.x" value=" OK ">
The following line refers to the form element that contains blocked addresses. It is supposed to go through all items in the list. i is a variable that points to the currently analysed item.
while (document.listsForm.destList.options.text != "")
The problem is that when i is increased, it will eventually be a higher number than there are items in the list and then cause an error because the script is trying to get the "text" content of an item that does not exist.
It should have been written
while (document.listsForm.destList.options && document.listsForm.destList.options.text != "")
I've saved a snapshot of the page Opera gets to prove that it is so broken it won't even work in IE:
Try to go there and click the "OK" button – you will get a scripting error. That's what we call "BAD": Broken As Designed.