jQuery logger plugin

后端 未结 1 861
隐瞒了意图╮
隐瞒了意图╮ 2020-12-21 07:47

I\'m working on a jQuery plugin that allows you to log any javascript class or object. The idea is to override each function inside the object, or prototype of a function.

相关标签:
1条回答
  • 2020-12-21 08:29

    Well look closely to the error.

    Uncaught ReferenceError: name is not defined
    

    Means you haven't defined name and since you are in strict mode, you can't use a variable without defining it(normally if you do it, it'll be a global variable, but not in strict mode). So if you write a var name before it you won't get this error anymore.

    Though there is another error for not having tab method. The other error says tabs is not a method of the object which is because when you wrap the function, you didn't inherit the prototype, so when the function is called with new, it doesn't have prototype functions(tabs is one of them).

    Here's the fixed code : http://jsfiddle.net/Sj6xN/8/

    0 讨论(0)
提交回复
热议问题