I agree and that was the spirit I tried to keep up during my project. However, when you have a language that runs inconsistently on different screens, you lose the positive energy you try to uphold so hard.
To be fair, most of these inconsistencies are due to our big old friend Microsoft and their Internet Explorer but it’s still hard to ignore Internet Explorer, so you need to deal with these inconsistencies on your own.
For example, Array.indexOf is a function that is supported by bunch of browsers like Firefox, Chrome, etc. but not in Internet Explorer. You don’t know that until you run your application against Internet Explorer.
Another example is XML support. In most browsers, you have DOMParser but in Internet Explorer, you need to use the ActiveXObject.
Yet another example is XMLHttpRequest. Most modern browsers handle it one way but in Internet Explorer 6, you need to use the ActiveXObject again. Even the ones that handle it regular don’t do it consistently. For example, in Firefox, when you try to send a POST request where the first byte is zero, the POST body is dropped.
For byte array support, Firefox has a XMLHttpRequest#sendAsBinary method but it’s not a standard so others don’t have it. Internet Explorer has some byte array support but it’s VBScript and not a standard again.
In HTML5 space, I don’t have much experience other than WebSockets and that is a little messy itself with some browsers supporting hixie-76 version, some supporting hixie-76 in disabled mode, some not supporting at all, and some planing to support hybi-10 I’m sure there are more differences in other areas like CSS or UI stuff.
So how do you deal with these? Unfortunately, there’s no great solution. Frameworks like JQuery somewhat helps with these problems but again with my Java and Flash background, I expect the language to work consistently across different screens and I find it a little backwards that I need to depend on a framework to do the right thing.
In our project, we didn’t want to depend on any external frameworks, so we created a central class to deal with cross browser issues and it helps that there’s one central abstracted place for all cross-browser issues but it’s far from ideal.
The key is to have great and automated tests that you can easily run against different browsers but which one to use? That’s a whole different topic that I’ll cover in my next post.