Alexandre,

Another word of caution. Do choose your labels carefully. Avoid
keywords.
Adding quotes to keyword labels ensure compatibility with YUI
compressor.

var a = {
        // new without quotes produce error in ie
        "new": function() {
                alert("new");
        },
        // class without quotes produce error in ie
        "class": function() {
                alert("class");
        },
        // YUI compressor won't compress if you have no quotes on keywords
        float: function() {
                alert("float");
        },
        int: function(){
                alert("int");
        }
}

a.new(); // still fails in ie
a.class(); // still fails in ie
a.float();
a.int();

Reply via email to