understand dojo/domReady!
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!的更多相关文章
- dojo/domReady! 中感叹号的作用
废话 其实不算个技术问题,但实在是花了我不少时间,不记下来都对不起我这浪费掉的几十分钟. 问题 在dojo官网上看教程,跟着做点练习,看到Dojo DOM Functions那节,有一个练习是改变页面 ...
- dojo 官方翻译 dojo/domReady 版本1.10
官方地址:http://dojotoolkit.org/reference-guide/1.10/dojo/domReady.html#dojo-domready dom加载完成后,执行. requi ...
- 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 ...
- 【原创】(AMD)JavaScript模块化开发(dojo)
AMD原理等在这里就不进行说明了,作者也是菜鸟一枚,只是对自己的一个实例进行说明,如有错误,望指出. 首先,先推荐一篇AMD方面的文章,有兴趣的可以参考:http://efe.baidu.com/bl ...
- Events with Dojo(翻译)
In this tutorial, we will be exploring dojo/on and how Dojo makes it easy to connect to DOM events. ...
- Using dojo/query(翻译)
In this tutorial, we will learn about DOM querying and how the dojo/query module allows you to easil ...
- Dojo特效(翻译)
http://dojotoolkit.org/documentation/tutorials/1.10/effects/index.html In this tutorial, we will exp ...
- DOJO DOM 功能
In this tutorial, you'll learn about how to use Dojo to manipulate the DOM in a simple, cross-browse ...
- 现代DOJO(翻译)
http://dojotoolkit.org/documentation/tutorials/1.10/modern_dojo/index.html 你可能已经不用doio一段时间了,或者你一直想保持 ...
随机推荐
- CentOS(RedHat)命令行永久修改IP地址、网关、DNS
1.修改IP地址vim /etc/sysconfig/network-scripts/ifcfg-eth0DEVICE=eth0 #网卡名称BOOTPROTO=static #获取ip的方式(stat ...
- JS添加父节点的方法。
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/ ...
- 20169212《Linux内核原理与分析》第四周作业
Linux第四周作业 1. 堆栈知识 首先回顾了下堆栈相关的知识,堆栈机制是高级语言可以运行的一个基础,这一块需要重点掌握.函数发生调用时,如图 call指令:将eip的按顺序执行的下一条指令(因为在 ...
- CSS3新增的选择器和属性
<!doctype html>无标题文档 一.新增的选择器 CSS3新增的属性选择器 {除ie6外的大部分浏览器支持) 序号 选择器 含义 实例 1 E[att^="val&qu ...
- 更新Debian软件源
更新Debian软件源 sudo cp /etc/apt/sources.list /etc/apt/sources.list_bak #备份一下软件源 sudo vi /etc/apt/source ...
- SQL Server系列
这里整理了我学习SQL Server的全部文章,包括从基础到高级,做一个目录,方便以后查找. SQL Server数据类型 SQL Server中开发常用的数据类型 单表查询和多表查询 一个单表查询的 ...
- CentOS 6.7 中安装Emacs 24.5
Emacs 版本:http://mirror.bjtu.edu.cn/gnu/emacs/emacs-24.5.tar.gz CentOS 内核版本:2.6.32-573.el6.x86_64 参考资 ...
- Install Atom editor in ubuntu 14.04
Step 1: Add repository sudo add-apt-repository ppa:webupd8team/atom Step 2: Update the repository su ...
- JAVA中最常用的十个快捷键
http://blog.sina.com.cn/s/blog_5fb39f910101dc2b.html 一个Eclipse骨灰级开发者总结了他认为最有用但又不太为人所知的快捷键组合.通过这些组合可以 ...
- 几个实用的mysql函数
在工作中,处理数据时候往往使用php要废很多脑筋和写很多东西,如果不考虑代码的阅读性试试几个mysql的函数可以解决许多常见需求: 1.截取字符串函数: left() 从左开始截取字符串 right ...