I’m currently involved in developing a web application of moderate complexity using Ext to provide a ‘Web 2.0’ front end on a PHP/mySQL application. We’ve endeavoured to make it work across a range of browsers – Firefox, IE, opera and Chrome. And this is the blog article in which I vent my spleen about Chrome.
Because, you see, there are some occasions when Chrome is an absolute bag of spanners that behaves in a manner that just beggars belief, and it worries me immensely. If IE behaved in the same way that Chrome does under certain conditions then the Chrome / Google Fanbois would be lighting their torches and waving their pitchforks as they headed out towards Castle Microsoft.
Watch the White Space
Chrome seems particularly sensitive to white space in places where you wouldn’t expect it to be. For example:
- Avoid spaces following closing braces ( } )at the end of a js source file.
- Avoid spaces around ‘=’ signs in assignments.
- Avoid blank lines within array definitions – don’t put any blank lines after an opening ‘[‘ before data.
Watch the comment lines
The // construct used to make a line in to a comment line needs to be handled with care with Chrome. Don’t include it in any object or array definitions – whilst it works OK in IE, it can cause major problems in Chrome.
Indications of problems
In summary, just be aware that Chrome may not be as well behaved as one would expect.
And that’s my whine for the day over!