Dojo入门三种HelloWorld!
来源:互联网 发布:企业网络危机公关 编辑:程序博客网 时间:2024/06/06 17:49
学习Dojo有些时间了,也整理了一些资料,先来个最入门级别的。HelloWorld
Asp.Net+Dojo
Dojo事件绑定,弹出HelloWorld
- <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="HelloWorldDojo.aspx.cs" Inherits="DojoTest.HelloWorldDojo" %>
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head runat="server">
- <title></title>
- <%-- 引入 Dojo--%>
- <script src="http://ajax.googleapis.com/ajax/libs/dojo/1.7.2/dojo/dojo.js"
- type="text/javascript"></script>
- <script type="text/javascript">
- function init() {
- //helloworld 函数到按钮的点击事件
- dojo.connect(dojo.byId("mybutton"), "onclick", "helloworld");
- }
- function helloworld() {
- alert("Hello World Dojo!!!")
- }
- dojo.ready(init);
- </script>
- </head>
- <body>
- <input id="mybutton" type="button" value="HelloWorldDojo" />
- </body>
- </html>
Dojo操作DOM版HelloWorld
- <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="HelloDojo.aspx.cs" Inherits="DojoTest.HelloDojo" %>
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head runat="server">
- <title></title>
- <script src="http://ajax.googleapis.com/ajax/libs/dojo/1.7.2/dojo/dojo.js" type="text/javascript"></script>
- <script type="text/javascript">
- dojo.ready(function () {
- dojo.create(
- "div",
- {
- "innerHTML": "Hello, World!"
- },
- dojo.body()
- );
- });
- </script>
- </head>
- <body>
- <h1>
- My First Dojo Program!</h1>
- <div id="message">
- Hello,Dojo!</div>
- </body>
- </html>
Dojo封装Ajax实现HelloWorld
- <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="HelloDojoAjax.aspx.cs"
- Inherits="DojoTest.HelloDojoAjax" %>
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head runat="server">
- <title></title>
- <script src="http://ajax.googleapis.com/ajax/libs/dojo/1.7.2/dojo/dojo.js" type="text/javascript"></script>
- <script type="text/javascript">
- function helloWorld(){
- dojo.xhrGet({
- url:"HelloDojo.txt",//请求的服务器资源url
- handleAs:"text",//返回的数据类型
- load:function(response,ioArgs){alert(response);},//成功后回调函数
- error:function(error,ioArgs){alert(error.message);}//出错时回调函数
- });
- }
- //绑定页面加载完成后的初始化函数
- dojo.ready(helloWorld);
- </script>
- </head>
- <body>
- </body>
- </html>
最近对Ajax关注多一些,可能会出一些dojo有关ajax方面的文章。dijit控件也可能谈一谈
0 0
- Dojo入门三种HelloWorld!
- Dojo入门三种HelloWorld!
- Dojo 基础入门(三)
- 三、rabbitMQ helloWorld入门程序
- Dojo入门:初识Dojo
- Dojo入门:Hello Dojo!
- Dojo入门:初识Dojo
- dojo 入门
- dojo 入门
- Dojo 入门
- dojo 入门
- Dojo 入门
- RabbitMQ(三)HelloWorld入门程序
- 接触Dojo,从HelloWorld开始
- 入门 HelloWorld!
- dojo入门(未完待续)
- Dojo 基础入门(一)
- Dojo 基础入门(二)
- 增强的for循环(不常用)
- mkdir命令
- JSON: The Fat-Free Alternative to XML
- Session的工作原理
- Linux下gSOAP生成webservice客户端代码 的使用心得
- Dojo入门三种HelloWorld!
- JVM内存区域划分Eden Space、Survivor Space、Tenured Gen,Perm Gen解释
- js寻路算法
- 【C#/OpenGL】将OpenGL的坐标系转换为普通屏幕坐标系处理的方法(基于CSGL)
- 什么是Dojo?与Jquery宏观对比,结果如何?
- 解决 ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES) 问题
- C#开发Unity游戏教程之游戏对象的行为逻辑方法
- 一步一步学内核(Linux kernel) -----之1:linux内核学习资料
- 黑马程序员——Java基础---集合总结