惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

V
Vulnerabilities – Threatpost
U
Unit 42
F
Fortinet All Blogs
aimingoo的专栏
aimingoo的专栏
P
Proofpoint News Feed
F
Full Disclosure
月光博客
月光博客
Engineering at Meta
Engineering at Meta
博客园_首页
The Register - Security
The Register - Security
G
Google Developers Blog
The Cloudflare Blog
博客园 - Franky
K
Kaspersky official blog
A
Arctic Wolf
Scott Helme
Scott Helme
C
Cisco Blogs
Hugging Face - Blog
Hugging Face - Blog
C
Check Point Blog
NISL@THU
NISL@THU
AI
AI
D
DataBreaches.Net
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Stack Overflow Blog
Stack Overflow Blog
Project Zero
Project Zero
The GitHub Blog
The GitHub Blog
H
Hackread – Cybersecurity News, Data Breaches, AI and More
量子位
Vercel News
Vercel News
T
Tor Project blog
P
Privacy International News Feed
D
Docker
I
Intezer
L
LangChain Blog
P
Proofpoint News Feed
Security Latest
Security Latest
C
CXSECURITY Database RSS Feed - CXSecurity.com
T
Threatpost
博客园 - 聂微东
AWS News Blog
AWS News Blog
Martin Fowler
Martin Fowler
P
Privacy & Cybersecurity Law Blog
V
V2EX
Last Week in AI
Last Week in AI
C
Cybersecurity and Infrastructure Security Agency CISA
The Hacker News
The Hacker News
T
Tenable Blog
Blog — PlanetScale
Blog — PlanetScale
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
T
Tailwind CSS Blog

博客园 - 阿木申

spring JPA 动态查询 iOS收到Push后播放声音和震动 [vb]sendkeys [vb]键盘精灵 - 阿木申 - 博客园 javascript 画带箭头的线段 关于input type='file'的内容的一种解决方法,模拟键盘 - 阿木申 - 博客园 防止IE缓存,就相当于IE选择每次打开就检查 - 阿木申 - 博客园 [dojo] 解决传中文的乱码问题 - 阿木申 - 博客园 [dojo] dojo.xhrGet和.net整合使用 [dojo]好用的页面对话框dijit.Dialog [dojo]日期选择:dijit.form.DateTextbox [dojo]功能强大的文本框:dijit.form.ValidationTextbox - 阿木申 - 博客园 dojo0.9 dojo.data研究笔记 [dojo] dojo 0.9 的使用心得 [原创]jBPM 子流程的使用 [原创]jBPM动态生成任务实例,会签或者分派任务时特别有用 [原创]jBpm中泳道使用心得 [原创]jBPM中的Expression和script [原创]JBPM中的基本操作代码
[dojo转]动态生成widget
阿木申 · 2007-07-03 · via 博客园 - 阿木申

应该算是比较常用的例子。摘自官方网站

 1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
 2<html>
 3    <head>
 4        <title>Non-markup widgets via createWidget</title>
 5        <script type="text/javascript">
 6            var djConfig = { isDebug: true };
 7        
</script>
 8        <script type="text/javascript" src="../../dojo.js"></script>
 9        <script type="text/javascript">
10            dojo.require("dojo.string.*");
11            dojo.require("dojo.widget.Button");
12
13            //
14            // Normal tests
15            //
16            dojo.addOnLoad(function() {
17                var w;
18                w = dojo.widget.createWidget("dojo:Button"{ caption: "Created as dojo:Button" });
19                dojo.byId("vanilla").appendChild(w.domNode);
20                w = dojo.widget.createWidget("Button"{ caption: "Created as Button" });
21                dojo.byId("vanilla").appendChild(w.domNode);
22                
23                // Cannot create components via createWidget
24                //var w = dojo.widget.createWidget("dojo:foo");
25            }
);
26
27            //
28            // Test auto-load
29            //    
30            dojo.registerModulePath("acme""tests/widget/acme");
31            dojo.registerNamespace("acme""acme.widget"
32                function(name)
33                        return "acme."+dojo.string.capitalize(name);
34            }
);
35            
36            dojo.addOnLoad(function() {
37                var w = dojo.widget.createWidget("acme:Button"{ caption: "Created with auto-require as acme:Button" });
38                dojo.byId("al").appendChild(w.domNode);
39            }
);
40
41            //
42            // Test passing a dom node as the first argument to createWidget()
43            //
44
45        
</script>
46    </head>
47    <body>
48        <h1>Test createWidget()</h1>
49        <div id="vanilla"></div>
50
51        <h1>Test createWidget()/auto-loading</h1>
52        <p>
53            This tests the ability for createWidget() to automatically load the code for a widget,
54            even though the user hasn't done a dojo.require() for the widget.
55        </p>
56        <div id="al"></div>
57    </body>
58</html>
59