require(["dojo/dom", "dojo/domReady!"], function(dom){
dom.byId("helloworld").innerHTML = "Hello New World!";
});

  

The sharped eyed among you will notice that there is a "module" in the requirement array that doesn't have a return variable, called dojo/domReady!. This is actually a loader "plugin" that is used to control the behaviour of the loader. This one ensures that the loader waits until the DOM structure for the page is ready. In an async world, it isn't a bright idea to assume that your DOM structure is there if you want to manipulate it, so if you are going to be doing something with the DOM in your code, make sure you include this plugin. Since we don't use the plugin in the code, it is the standard convention to put it at the end of the array and not provide a return variable for it.

understand dojo/domReady!的更多相关文章

  1. dojo/domReady! 中感叹号的作用

    废话 其实不算个技术问题,但实在是花了我不少时间,不记下来都对不起我这浪费掉的几十分钟. 问题 在dojo官网上看教程,跟着做点练习,看到Dojo DOM Functions那节,有一个练习是改变页面 ...

  2. dojo 官方翻译 dojo/domReady 版本1.10

    官方地址:http://dojotoolkit.org/reference-guide/1.10/dojo/domReady.html#dojo-domready dom加载完成后,执行. requi ...

  3. Dojo: Quick Start

      1.Dojo学习地址 2.Dojo快速开始 2.1.Dojo引入 2.2.指定Dojo模块的位置 2.3.模块加载require 3.查找Dom节点 3.1.根据id查找dom节点 3.2.根据c ...

  4. 【原创】(AMD)JavaScript模块化开发(dojo)

    AMD原理等在这里就不进行说明了,作者也是菜鸟一枚,只是对自己的一个实例进行说明,如有错误,望指出. 首先,先推荐一篇AMD方面的文章,有兴趣的可以参考:http://efe.baidu.com/bl ...

  5. Events with Dojo(翻译)

    In this tutorial, we will be exploring dojo/on and how Dojo makes it easy to connect to DOM events. ...

  6. Using dojo/query(翻译)

    In this tutorial, we will learn about DOM querying and how the dojo/query module allows you to easil ...

  7. Dojo特效(翻译)

    http://dojotoolkit.org/documentation/tutorials/1.10/effects/index.html In this tutorial, we will exp ...

  8. DOJO DOM 功能

    In this tutorial, you'll learn about how to use Dojo to manipulate the DOM in a simple, cross-browse ...

  9. 现代DOJO(翻译)

    http://dojotoolkit.org/documentation/tutorials/1.10/modern_dojo/index.html 你可能已经不用doio一段时间了,或者你一直想保持 ...

随机推荐

  1. CentOS(RedHat)命令行永久修改IP地址、网关、DNS

    1.修改IP地址vim /etc/sysconfig/network-scripts/ifcfg-eth0DEVICE=eth0 #网卡名称BOOTPROTO=static #获取ip的方式(stat ...

  2. Linux下面CentOS 7桌面的安装

    搭建本地yum仓库的方法 http://www.cnblogs.com/lql123/p/5952788.html 1.yum grouplist #列出yum仓库里的软件组列表 2.yum grou ...

  3. 数据加密标准——DES

    DES算法和DESede算法统称DES系列算法.DES算法是对称加密算法领域中的典型算法,为后续对称加密算法的发展奠定了坚实的基础.但是DES算法密钥偏短,仅有56位,迭代次数偏少,受到诸如查分密码分 ...

  4. 完美解决google无法访问

    1.进入短信界面 2.菜单-设置 3.修改短信中心号码(Set the SIM's smsc number) 保存 [测试结果]:提示保存成功,但是号码没有改变,退出重新进入设置才会看到号码更新 [预 ...

  5. 转-IE浏览器自动配置代理脚本-Proxy.PAC文件及PAC相关语法

    用笔记本上网时,往返家里和单位,因为单位是用的代理上网,家里是直接连接.因此每次都要修改IE的代理设置,虽然是个小事,但是每次都要修改总是有点烦 ,于是参考GOOGLE,写了一个自动配置代理的脚本.这 ...

  6. 《Android深度探索》(卷1)HAL与驱动开发读后感:

    第一章:安卓系统移植与驱动开发概述 全书分为4篇,分别从搭建开发环境,Linux驱动和Android HAL的基础知识,开发Linux驱动的高级技术和分析典型的Linux驱动源代码4个方面介绍Andr ...

  7. 读取微博feed伪代码

    // 读取我的好友fids $db = new DB(); $mc = new Memcached(); $_uid = 1; // my uid $sql = "select * from ...

  8. delphi Syntax check、 build、 run、 compile的区别

    delphi Syntax check. build.  run. compile的区别 Build是从新编译所有和生成exe有关的文件,无论.pas文件是否修改过,它都会重新生成新的.dcu,并从新 ...

  9. MySQL正则表达式

    正则表达式作用是匹配方本,将一个模式(正则表达式)与一个文本串进行比较. MySQL用WHERE子句对正则表达式提供了初步的支持,允许你指定用正则表达式过滤SELECT检索出的数据. MySQL仅支持 ...

  10. Australian troops to the fight against Islamic State militants.

    He arrived in Arnhem Land on Sunday, honouring an election promise to spend a week every year in an ...