最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - require js jquery plugins - Stack Overflow

programmeradmin4浏览0评论

Do I have to write wrappers for each jQuery plugin I am trying to use in require.js? I can't user the order plugin they still give me the error that they depend on jQuery.

Thanks

Do I have to write wrappers for each jQuery plugin I am trying to use in require.js? I can't user the order plugin they still give me the error that they depend on jQuery.

Thanks

Share Improve this question asked May 29, 2012 at 12:38 onlineracoononlineracoon 2,9705 gold badges48 silver badges66 bronze badges 1
  • Could you explain more? Examples of the plugins you're trying to use and how you're bining them would be useful. It's worth noting that all jQuery plugins will obviously require a jQuery include somewhere on the same page, if that's the problem you're having. – Death Commented May 29, 2012 at 12:41
Add a ment  | 

2 Answers 2

Reset to default 11

RequireJS 2.0 has a shim option that allows you to use older non-AMD scripts as modules - http://requirejs/docs/api.html#config-shim

Have you read How to use require js with jquery? It explains that you can use require js to load jquery and jquery plugins by using a bined jquery/requirejs file. You can find a sample project here. There are also several alternative strategies listed in the sample project's readme.

发布评论

评论列表(0)

  1. 暂无评论