[英]Write a simple zepto plugin
I'm writing a couple of simple zepto plugins that I would like to use in my application: 我正在写一些我想在我的应用程序中使用的简单zepto插件:
https://github.com/Pherserk/symfony2_demo_article_feed/tree/partial/feature-user-creation/src/AppBundle/Resources/public/js/JsonApiAjax.js https://github.com/Pherserk/symfony2_demo_article_feed/tree/partial/feature-user-creation/src/AppBundle/Resources/public/js/JsonApiAjax.js
https://github.com/Pherserk/symfony2_demo_article_feed/tree/partial/feature-user-creation/src/AppBundle/Resources/public/js/JwtAjax.js https://github.com/Pherserk/symfony2_demo_article_feed/tree/partial/feature-user-creation/src/AppBundle/Resources/public/js/JwtAjax.js
Including the zepto library and the two files above I get the error TypeError: $.JwtAjax is not a function
包括zepto库和上面的两个文件我得到错误TypeError: $.JwtAjax is not a function
Here is the code of the page calling it: 这是调用它的页面的代码:
https://github.com/Pherserk/symfony2_demo_article_feed/blob/partial/feature-user-creation/src/AppBundle/Resources/views/Web/Main/writeArticle.html.twig https://github.com/Pherserk/symfony2_demo_article_feed/blob/partial/feature-user-creation/src/AppBundle/Resources/views/Web/Main/writeArticle.html.twig
Any help would be appreciated. 任何帮助,将不胜感激。
I was missing this: 我错过了这个:
$.JwtToken = $.fn.JwtToken; $ .JwtToken = $ .fn.JwtToken;
That is declaring the function a the level of the $ namespace as alias of the function defintion at $.fn namespace. 这就是将函数声明为$ namespace的级别,作为$ .fn命名空间中函数定义的别名。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.