Environment: FireFox 5 Firebug 1.7.3 On Jul 4, 3:30 pm, Sam3k <[email protected]> wrote: > Why does the following script works within the application code but it > doesn't when I type it in the firebug console. It throws the following > error: > > TypeError: debug.log is not a function > > My goal with this script is to make an object from where I can log > things to the console, store javascript speed performance in different > areas, and turn off if no cookie is set. > > file: Debugger.js > (function (window, undefined) { > > function Debugger() { > this.test = 'xxxxxx'; > } > > Debugger.prototype.log = function(data) { > console.log(data); > } > > var _debug = new Debugger(); > > window.debug = _debug; > > debug.log('DEFE"DEFEF'); // this works > > })(window); > > debug.log('OUTSIDE DKEGFYG'); // this works too > > Also any constructive feedback is greatly appreciate it.
-- To view archived discussions from the original JSMentors Mailman list: http://www.mail-archive.com/[email protected]/ To search via a non-Google archive, visit here: http://www.mail-archive.com/[email protected]/ To unsubscribe from this group, send email to [email protected]
