Jump to content
Larry Ullman's Book Forums

Recommended Posts

There are few mistakes in the book that is corrected in Errata Source Code.


    addEvent() function.addEvent: function(obj, type, fn) {
        'use strict';
        if (obj && obj.addEventListener) { // W3C
            obj.addEventListener(type, fn, false);
        } else if (obj && obj.attachEvent) { // Older IE
            obj.attachEvent('on' + type, fn);
    }, //  In the Source Code
addEvent : function(obj,type,fn){
'use strict';
if(obj && obj.addEventListener){
}//inner IF
else if (obj && obj.attachEvent){
obj.attachEvent('on' + type, fn);
}// Else IF
},//  Object Property function written in the book  :mellow:
Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...