dojo/query 不好用, 想用jquery做dom查询, 列子如下, 注意jquery的路径就好了
<script type="text/javascript"
src="https://ajax.googleapis.com/ajax/libs/dojo/1.7.0/dojo/dojo.js"
data-dojo-config="async: true, packages: [
{ name: 'jquery', location: 'http://ajax.googleapis.com/ajax/libs/jquery/1.7.1',
main: 'jquery' }
]">
</script>
The second step is to modify our source code to add the actual loading of jQuery through the require function:
<script type="text/javascript">
define.amd.jQuery = true;
require(["jquery", "dojo/query", "dojo/NodeList-dom"], function(jquery, $){
$("output").style("visibility", "visible");
jquery("#output").css("visibility", "hidden");
});
</script>
Dojo中加载jQuery
本文介绍了一种在Dojo框架中加载并使用jQuery的方法。通过配置Dojo来加载jQuery库,实现了利用jQuery进行DOM操作的功能。这种方法为开发者提供了更多的灵活性。
290

被折叠的 条评论
为什么被折叠?



