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一段时间了,或者你一直想保持 ...
随机推荐
- 解决: org.iq80.leveldb.DBException: IO error: C:\data\trie\000945.sst: Could not create random access file.
以太坊MPT树的持久化层是采用了leveldb数据库,然而在抽取MPT树代码运行过程中,进行get和write操作时却发生了错误: Caused by: org.fusesource.leveldbj ...
- java_ee_sdk-7u2的安装与 启动
1.在oracle官方网站上下载JAVA EE SDK,现在最新的版本是java_ee_sdk-7u2 2.最新的版本是免安装模式,所以比较方便.但是通常免安装模式没有快捷方式,不知道怎么启动.怎么使 ...
- php 使用curl模拟登录人人(校内)网
$login_url = 'http://passport.renren.com/PLogin.do'; $post_fields['email'] = 'XXXX';$post_fields['pa ...
- ionic 初入门
ionic ionic 是webapp开发的一个框架 安装 npm install -g cordova ionic ; 我这两个分开装,因为ionic模块拖不下来,所以只好等待时机.这时候科学上网 ...
- [转]Bat脚本处理ftp超强案例解说
Bat脚本处理ftp超强案例解说 转自:http://369369.blog.51cto.com/319630/842341 前言: 公司有几百台windows服务器,每次程序更新,如果是一台 ...
- c语言基础表达式, 关系运算符, 逻辑运算符, 位运算符, 数据的取值范围, 分支结构(if...else, switch...case)
1.表达式: 表达式的判断是有无结果(值), 最简单的表达式是一个常量或变量, 如:12, a, 3 + 1, a + b, a + 5 都是表达式 2.BOOL(布尔)数据类型: c语言中除了基本数 ...
- Adapter 代码中启动报错
安装好Adapter之后,在designer中可以启动Adapter,但在代码中启动却总是报错,“could not create RVMQSession"或者是“native implem ...
- Bootstrap <基础十二>下拉菜单(Dropdowns)
Bootstrap 下拉菜单.下拉菜单是可切换的,是以列表格式显示链接的上下文菜单.这可以通过与 下拉菜单(Dropdown) JavaScript 插件 的互动来实现. 如需使用下列菜单,只需要在 ...
- C# 数据类型
1.整数类型: int 只能 存储证书,不能存储小数. 2.小数类型: doubie 机能存储整数,也能存储小数,小数点后面的额 15-16位. 3.金钱类型: decimal:用来存储金钱, ...
- OC基础--self关键字
Self的使用: 1 self不能离开类 离开类之后没有任何意义 2 self会自动区分类方法和对象方法 3 使用self的时候只需要关注self在哪一个方法中 如果在类方法中使用self 那 ...