May 3, 2009
Now I’d normally be the first one to speak out in favour of unobtrusive JavaScript and attempting to keep CSS styling out of JavaScript. Rarely should you need to directly impose CSS styles on an element via the style object, after all that is what class names are for. However there are some styles that are commonly and justifiably manipulated within JavaScript; display, visibility, width, height, top, and left are just a few of the styles often directly manipulated within JavaScript typically for some type of UI component. Of course, some of these styles are not supported in all the mainstream browsers, such as opacity in IE and -moz-transform in Firefox < 3.5. read more »
April 19, 2009
As a followup to my last post regarding browser detection, I have decided to release a new standalone and lightweight library that will hopefully put browser sniffing to rest once and for all. In a project I’ve entitled Env (short for environment), you now have the power of knowing exactly what your browser environment is and is not capable of without actually knowing what browser it is. Many of the features and bugs that are often encountered during runtime no longer need to be sniffed out by the user agent, despite the fact that some of the mainstream libraries still insist upon it. In addition to bug and feature testing, the library also supports advanced type detection and event support detection to further enhance your usability, but also separate your dependence on browser sniffing. Goodbye navigator.userAgent and good riddens – you’ve broken my app for the last time! read more »
March 8, 2009
It is rarely even a question anymore; deciding whether to use a JavaScript library on your next project typically goes without saying, the real question developers find themselves asking is which library should it be? However the decision to adopt any framework for a project should not be taken lightly and deserves a proper evaluation of requirements before making a decision based on assumptions. Often a library may ask of a developer, “Does the JavaScript library help me to write JavaScript?”, but shouldn’t they ask if the library helps them to learn JavaScript? Learning the syntax of your favourite JavaScript library does nothing for the developer’s understanding of the language itself or the impact on performance, memory, and reliability of their implementations. For this article, I will be looking at both sides of the argument, but hiding my bias will not be easy, my hope here is that perhaps a few developer’s may rethink their approach. read more »