Archive for the ‘Javascript’ Category

Can’t move focus to control?

Thursday, March 6th, 2008

So like me you spent 30 minutes trying to fix this Internet Explorer JavaScript error ?

Cant move focus to the control because its invisible , not enabled, or a type that does not accept the focus.

In that case don’t waste time trying to understand it, odds are you have conflicting ids in your document. Also, remember IE 7 and the previous versions are alone to think a name attribute should be treated like an id.

OOP Javascript

Sunday, February 10th, 2008

If you’re anything like me, hardcore object-oriented Javascript coding always come with unexpected errors and some of the strangest behavior you can’t really explain.

But that’s always the programmer’s fault, of course.  It turns out Javascript isn’t made to be used in a object-oriented way, but rather in a prototype-oriented fashion.

This lengthy post compares Java and Javascript and explains how a Javascript programmer
should implement object inheritance.

I found a few things strikingly useful in there, notably the delegation of the whole obj.prototype reference and the fact he never explicitly declares any class attributes as he does in Java (and how we were trained to do it).

Yahoo! as Standard Makers

Monday, June 11th, 2007

Long time indifference

Yahoo! is not a place I like to hang around. I guess it has all to do with how they handled the presentation of their search results back in the day. I never was a fan of categorized results — at least wasn’t ready to try harder to use them at that time.

So, for years I’ve been using AltaVista, then Google instead of Yahoo! search; Hotmail, then GMail instead of Yahoo! mail. Since I don’t like to be overrun with data, I don’t even read the news on their portal. The NY Times‘ and Radio-Canada’s RSS feeds suit me better.

In other words, I am not part of the gazillions of people that help make Yahoo! the most important website on the Internet at the moment, according to Alexa. I didn’t have much of an opinion on Yahoo! until they go so useful for the web developer I am.

YUI

Yahoo! Developer Network is a priceless resource for information on popular web technologies. What I’m more interested in however is the YUI section — the Yahoo! User Interface Libary.

Javascript

YUI seems to be built around Yahoo!’s own Javascript library. Similar to jQuery and Prototype, the YUI library helps writing Javascript code that is more efficient more quickly. Yahoo!’s library has proven to work faster than its competitors when working on the DOM. It is structured in a manner that seems closer to more classic programming languages.

Notably, you can create namespaces for your scripts as well fire as custom events. Obviously, you can create visual effects of custom controls for your interface using objects the community is developing. Broken down in many files, you can import only the libraries you need in your application from Yahoo!’s servers. No hassle in storing multiple version of the files.

Templates

The section supplies a collection of pre designed templates for anyone to use. Wether you need a 3 column fixed layout, or fluid 100% wide 5 columns templates, you will find the XHTML and CSS files in the YUI section completely free. Free as in no charge, but also free as in open source.

Cross-platform

Most importantly, the library is guaranteed to be working the same on any Grade A browser. Other libraries don’t always live up to that mention as the script gets more complicated.

Standard Pipes

While the tools themselves are incredibly useful and time saving, it’s not the best thing about the YUI. Through guidelines, tutorials and free files, Yahoo! is lowering the pain of doing web design for people who don’t know about standards or who just don’t care. If an important company like Yahoo! continues providing resources and using their influence in the developer’s community and the software makers building the browser, the Internet can standardize fairly quickly.

Yahoo! seems to be pushing towards a better Internet and the same cannot be said of everyone in the top most influential website.