开发者

"Function is not defined" - jQuery Plugins Question

I have a plugin in my plugins.js file that looks like this:

var ShowCredits=function(){var a={addEvent:function(b,c,d,e){if(b.addEventList ...etc

Over in my functions.js file I have this:

var credits = new ShowCred开发者_如何学Pythonits();
credits.code = function() { ...etc

When I lint, I get the following error message:

var credits = new ShowCredits();
'ShowCredits' is not defined.

Which makes sense because of the way the plugin is written.

Is there a way to re-write this so that the code validates?

Thanks a lot,

-Yahreen


The keyword new is to instantiate an object of the given class. Obviously, you don't define a class but a function. So just remove "new"

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜