ionezation Posted March 5, 2014 Share Posted March 5, 2014 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){ obj.addEventListener(type,fn,false); }//inner IF else if (obj && obj.attachEvent){ obj.attachEvent('on' + type, fn); }// Else IF },// Object Property function written in the book Link to comment Share on other sites More sharing options...
Recommended Posts