将requirejs与dojo 1.9.1一起使用(Using requirejs with dojo 1.9.1)
任何人都可以为我提供一个如何使用requirejs加载dojo模块的简单示例吗?
requirejs.org网站表明最好使用dojo加载器,直到故障 单解决 - 但该故障单似乎已解决,现在已关闭。
我现在只遇到dojo 1.9.1时遇到的错误,如下所述 (下面重复)。
错误:
TypeError:_3.add不是函数_3.add(“dom-addeventlistener”,!! document.addEventListener);
(我有一个使用requirejs的现有骨干应用程序,我只是尝试集成dojo图表)。
Can anybody provide me with a simple example of how to use requirejs to load dojo modules?
The requirejs.org website indicates it is best to use the dojo loader until a ticket is resolved - but that ticket appears to be resolved and is now closed.
I am encountering errors such as described here (duplicated below) only now with dojo 1.9.1.
Error:
TypeError: _3.add is not a function _3.add("dom-addeventlistener",!!document.addEventListener);
(I have an existing backbone app that uses requirejs and am simply trying to integrate in dojo charting).
原文:https://stackoverflow.com/questions/17475515
最满意答案
您需要使用Dojo Toolkit的源/ SDK版本 。 AMD模块的内置副本在加载器之间不兼容。
You need to use the source/SDK version of the Dojo Toolkit. Built copies of AMD modules are not compatible between loaders.
相关问答
更多-
您可以为常规站点设置不同的配置设置,也可以为优化器提供不同的配置设置,因此在这种情况下,您可以在优化器版本中使用“空”配置,以便它不包含组合/缩小版本中的jQuery : paths: { jquery: "empty:" } 有关详细信息,请参阅文档: http : //requirejs.org/docs/optimization.html#empty You can have different configuration settings for your regular site vs. ...
-
两个jQuery的一个RequireJS(Two jQuery's one RequireJS)[2022-09-07]
也许试试这个: 编辑 : require.config({ paths: { jquery: "..components/jquery/jquery.min", jquery172: "../components/jquery/jquery-1.7.2.min", jquery191: "../components/jquery/jquery-1.9.1.min" } }); // use jQuery 1.7.2 here define(" ... -
可能有多种方法可以让Dojo工具包与Ruby on Rails一起使用。 这是最简单的,即使不是最有效的方式。 这适用于Rails 4.2.0。 我想它也适用于其他版本。 在views / layouts / application.html.erb中,在包含站点脚本之前添加以下内容: <%= javascript_include_tag 'http://ajax.googleapis.com/ajax/libs/doj ...
-
当你使问题更清楚时,我编辑我的答案。 在任何包含require.js页面中,您还应该包含main.js来定义RequireJS配置。 你做不到这样的事情 define(["main", "jquery", function(main, $) { // do some public stuff }); 因为ReuiqreJS异步加载依赖项。 虽然“main”位于“jquery”之前,但不能保证RequireJS会按顺序加载它们。 所以你的public / index.html可以是这样的:您需要使用Dojo Toolkit的源/ SDK版本 。 AMD模块的内置副本在加载器之间不兼容。 You need to use the source/SDK version of the Dojo Toolkit. Built copies of AMD modules are not compatible between loaders.您已经创建了一个命名的AMD模块,通过创建第一个参数来define 'categories' 。 在可能的情况下最好避免这种情况: 您可以自己明确命名模块,但它会使模块的可移植性降低 - 如果将文件移动到另一个目录,则需要更改名称。 通常最好避免使用模块名称进行编码,只需让优化工具在模块名称中进行刻录。 尝试将categories.js调整为: define(function() { return function CategoriesCtrl(layers) { // etc ...为了让sammy工作,我只是放弃$. 因为我正在注射它 @router = sammy( -> @get( '#/', ( data ) -> self.sammypath( 1 ) ) ) 不幸的是,我似乎无法让$.sammy工作。 RequireJs文档提供了一些关于如何让$.sammy工作的提示 var require = { deps: ["some/module1", "my/module2", "a.js", "b.js"], callback: functi ...将我的buid文件更改为 baseUrl: '../', name: 'js/libs/almond', include: ['app/main'], insertRequire: ['app/main'], out: '../../www/app/main.js', //wrap: true, 并删除wrap:true选项其工作probbaly 谢谢 after changing my buid file to baseUrl: '../', name: 'js/libs/almond', includ ...Ace的作者建议使用master分支中的最新版本,该版本应该与最近的RequireJS兼容。 顺便说一句,您能否在某处发布如何使用RequireJS运行Dojo 1.7.2? Ace's authors recommend using the newest version from the master branch which should be compatible with recent RequireJS. BTW, could you post somewhere how you managed ...
在RequireJS上运行Dojo(Running Dojo on RequireJS)[2022-09-03]
假设您使用Dojo加载程序以减少代码大小,构建Dojo的CDN版本。 代码删除的一部分是替代的has.js实现,如果加载器不包含一个(如RequireJS),则使用该实现。 您可以使用常规下载的Dojo和RequireJS版本,它可以正常工作,但您不能使用CDN版本。 The CDN version of Dojo is built assuming that you are using the Dojo loader in order to decrease code size. Part of the ...相关文章
更多- solr4.5安装配置 linux+tomcat6.0+mmseg4j-1.9.1分词
- solr4.7配置(ik-analyzer)
- Lucene4源代码分析之一:源代码导入Eclipse
- 尚硅谷Java视频教程_SSH整合&综合案例 视频教程【主讲:佟刚】
- 安装solr中文分词系统
- solr在tomcat下集成mmseg
- solr配置中文分词器mmseg4j
- Hadoop Ubuntu集群安装
- Select2在Bootstrap 3 Modal框中不能搜索的解决方法
- rails3+mongrel1.2.0pre2在windows下面的生产环境配置问题
最新问答
更多- Apache HttpClient(4.1和更新版本):如何进行基本身份验证?(Apache HttpClient (4.1 and newer): how to do basic authentication?)
- 复选框不适用于模态(Checkbox does not work in modal)
- 当使用大标题无法正常工作时,iOS 11会滚动到顶部(iOS 11 scroll to top when using large titles doesn't work properly)
- 为什么我的Arduino不能超过10?(Why can't my Arduino compare above 10?)
- 从Lib中删除PDB文件/功能(Remove the PDB file/functionality from Lib)
- rails-2.3.5和rack-1.0.1的来源在哪里?(Where are the sources for rails-2.3.5 and rack-1.0.1?)
- 如何使用List <>成员不可变的类?(How to make a class with List<> member immutable?)
- Microsoft Edge popup扩展如何获取后台页面?(Microsoft Edge popup extension how to get backgroundpage?)
- python删除中文unicode字符串之间的空格,但不删除英文单词之间的空格(python to remove space between Chinese unicode strings but not between English words)
- SBT:如何Dockerize一个胖罐子?(SBT: How to Dockerize a fat jar?)
- 如何从服务器请求中保存图像的分区以便以后合并(How to save segements of image in memory from server request for merging later)
- python这段程序中a=self.[:]是什么意思 self一般用法是啥
- ActiveRecord :: StatementInvalid:PGError:错误:关系“指令”不存在(ActiveRecord::StatementInvalid: PGError: ERROR: relation “instructions” does not exist)
- 虚拟机安装kail linux最低配置是多少?
- fread()中的空字符和c中的strncpy()(Null character in fread() and strncpy() in c)
- 从ShutdownHook中查找程序退出的原因(Find, from a ShutdownHook, why a program exits)
- 每天在固定时间运行任务(Run a task at fixed time everyday)
- 电脑开不了机了,开机后进了桌面,显示WINDOWS BOOT MANAGER
- 获取字符串第n个出现的索引?(Get the index of the nth occurrence of a string?)
- python selenium 怎么打开 Chrome 并且能设置代理,请问可以指导小弟一下吗。
- 错误:imagecopymerge()期望参数2是资源(Error: imagecopymerge() expects parameter 2 to be resource)
- 在我的代码中,“无法找到可安装的ISAM”错误的原因是什么?(What could be the cause of 'Could not find installable ISAM' error in my code?)
- Access 2013 - 没有自动编号的顺序编号(Access 2013 - sequential numbering without autonumber)
- 将带有函数的Javascript对象转换为字符串(Converting a Javascript Object with Functions into a String)
- Java中实现封装与信息隐藏与抽象与隐藏数据的比较(Practical example Encapsulation vs Information Hiding vs Abstraction vs Data Hiding in Java)
- 不要包必须匹配java文件所在的子目录吗?(Don't packages have to match the subdirectories the java file is in?)
- PyCharm Python控制台中的文件路径错误(File path wrong in PyCharm Python Console)
- 在数据框列上应用curve_fit(Apply curve_fit on dataframe columns)
- Java中的DateTime.FromOADate()相当于什么(Java中的Datetime是Datetime的两倍)(What is the equivalent of DateTime.FromOADate() in Java (double to Datetime in Java))
- 给定DCEL,其中双胞胎等于下一个边缘,细分可以有多少面?(Given a DCEL where the twin is equal to the next of an edge, how many faces can the subdivision have?)