⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 part 3 javascript programming with dojo and dijit the dojo toolkit.mht

📁 dojo学习资料,从初级开始学起,是初学都认识dojo的好帮手.
💻 MHT
📖 第 1 页 / 共 5 页
字号:
From: <由 Windows Internet Explorer 7 保存>
Subject: Part 3: JavaScript Programming With Dojo and Dijit | The Dojo Toolkit
Date: Sun, 2 Dec 2007 16:35:13 +0800
MIME-Version: 1.0
Content-Type: multipart/related;
	type="text/html";
	boundary="----=_NextPart_000_02D9_01C83501.5012FC00"
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3198

This is a multi-part message in MIME format.

------=_NextPart_000_02D9_01C83501.5012FC00
Content-Type: text/html;
	charset="utf-8"
Content-Transfer-Encoding: quoted-printable
Content-Location: http://dojotoolkit.org/book/dojo-book-0-9/part-3-programmatic-dijit-and-dojo-0

=EF=BB=BF<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" =
"http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd">
<HTML lang=3Den xml:lang=3D"en" =
xmlns=3D"http://www.w3.org/1999/xhtml"><HEAD><TITLE>Part 3: JavaScript =
Programming With Dojo and Dijit | The Dojo Toolkit</TITLE><!--=0A=
	section: docs -->
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Dutf-8"><LINK=20
href=3D"/book/dojo-book-0-9/part-2-dijit/a11y/dojo-accessibility-resource=
s"=20
rel=3Dprev><LINK href=3D"/book/dojo-book-0-9-0" rel=3Dup><LINK=20
href=3D"/book/dojo-book-0-9/part-3-programmatic-dijit-and-dojo/functions-=
used-everywhere"=20
rel=3Dnext><LINK href=3D"/sites/all/themes/dtk/favicon.ico" =
type=3Dimage/x-icon=20
rel=3D"shortcut icon">
<META content=3Den name=3Dlanguage>
<STYLE type=3Dtext/css media=3Dall>@import url( =
/files/css/4538c7b86f5ddf0e20fe837f59d90fef.css );
</STYLE>

<SCRIPT src=3D"http://dojotoolkit.org/dojo/config/6"=20
type=3Dtext/javascript></SCRIPT>

<SCRIPT=20
src=3D"http://dojotoolkit.org/sites/all/modules/dojo/dtk_build/dojo/dojo.=
js"=20
type=3Dtext/javascript></SCRIPT>

<SCRIPT =
type=3Dtext/javascript>dojo.addOnLoad(function(){dojo.addClass(dojo.body(=
),"tundra");});</SCRIPT>

<SCRIPT type=3Dtext/javascript>dojo.require("dojo.parser");</SCRIPT>

<SCRIPT =
type=3Dtext/javascript>document.documentElement.className=3D"js";</SCRIPT=
>

<SCRIPT src=3D"http://dojotoolkit.org/sites/all/themes/dtk/js/common.js" =

type=3Dtext/javascript></SCRIPT>

<SCRIPT type=3Dtext/javascript>
	dojo.require("dijit._base.sniff");
	</SCRIPT>

<META content=3D"MSHTML 6.00.6000.16544" name=3DGENERATOR></HEAD>
<BODY class=3D"" id=3Dbdy>
<DIV id=3Dpage-block><!-- region_user_header.php -->
<DIV id=3Dlogin-block><SPAN id=3Duser-header>&nbsp;</SPAN> <SPAN =
id=3Dlogin-prompt><A=20
href=3D"http://dojotoolkit.org/user">Login</A></SPAN> <SPAN =
id=3Dregister-prompt><A=20
href=3D"http://dojotoolkit.org/user/register">Register</A></SPAN> =
</DIV><!-- /region_user_header.php -->
<DIV id=3Dbody-block><!-- region_header.php -->
<DIV id=3Dlogo-block>
<DIV id=3Ddojo-logo><A title=3DHome =
href=3D"http://dojotoolkit.org/"><IMG=20
id=3Ddojo-logo-img alt=3D"The Dojo Toolkit"=20
src=3D"http://dojotoolkit.org/sites/all/themes/dtk/img/banner-logo-text.g=
if"></A>=20
</DIV>
<DIV id=3Dsearch-block>
<FORM id=3Dsearch-theme-form action=3D/search/node method=3Dpost>
<DIV>
<H6 class=3Dhidden><LABEL =
for=3Dsearch_theme_form_keys>Search</LABEL></H6>
<DIV class=3Dcontainer-inline id=3Dsearch>
<DIV class=3Dform-item><INPUT class=3Dform-text =
id=3Dedit-search-theme-form-keys=20
title=3D"Enter the terms you wish to search for." maxLength=3D128 =
size=3D25=20
name=3Dsearch_theme_form_keys><BUTTON class=3Dform-submit =
id=3Dedit-submit-1 name=3Dop=20
type=3Dsubmit><SPAN class=3Dhidden>Search</SPAN></BUTTON> <INPUT=20
id=3Dedit-search-theme-form type=3Dhidden value=3Dsearch_theme_form =
name=3Dform_id>=20
<INPUT id=3Da-unique-id type=3Dhidden =
value=3Df294fc029c5c18cf4561f5162d590cec=20
name=3Dform_token> </DIV></DIV></DIV></FORM></DIV></DIV><!-- =
/region_header.php -->
<DIV id=3Dglobal-menu-block>
<UL id=3Dglobal-menu>
  <LI id=3Dnav-about><A class=3Dplink =
href=3D"http://dojotoolkit.org/about">About</A>=20
  <LI id=3Dnav-demos><A class=3Dplink =
href=3D"http://dojotoolkit.org/demos">Demos</A>=20
  <LI id=3Dnav-downloads><A class=3Dplink=20
  href=3D"http://dojotoolkit.org/downloads">Downloads</A>=20
  <LI id=3Dnav-documentation><A class=3Dplink=20
  href=3D"http://dojotoolkit.org/docs">Documentation</A>=20
  <LI id=3Dnav-support><A class=3Dplink=20
  href=3D"http://dojotoolkit.org/support">Support</A>=20
  <LI id=3Dnav-community><A class=3Dplink=20
  href=3D"http://dojotoolkit.org/community">Community</A>=20
  <LI id=3Dnav-fullmenu><A onclick=3D"return false;"=20
  =
href=3D"http://dojotoolkit.org/book/dojo-book-0-9/part-3-programmatic-dij=
it-and-dojo-0#fullmenu">Full=20
  Menu</A> </LI></UL></DIV><!-- region_banner.php -->
<DIV class=3Dbanner-docs id=3Dbanner-block>
<DIV id=3Dsection-heading>
<P>Documentation</P></DIV>
<DIV id=3Dsection-subheading>
<P>learn about the dojo toolkit</P></DIV></DIV><!-- /region_banner.php =
-->
<DIV id=3Dtop-breadcrumb-block>
<DIV class=3Dbreadcrumb><A href=3D"http://dojotoolkit.org/">Home</A> =
=C2=BB <A=20
href=3D"http://dojotoolkit.org/book/dojo-book-0-9-0">The Book of =
Dojo</A> =C2=BB Part=20
3: JavaScript Programming With Dojo and Dijit</DIV></DIV>
<DIV id=3Dcontent-block>
<DIV class=3Dcols-narrow-wide>
<DIV class=3D"col-a content-region-container" =
id=3Dsidebar-left-container>
<DIV class=3Dcontent-block><!-- Block: menu -->
<DIV class=3D"block block-menu" id=3Dblock-menu-572>
<H2 class=3Dtitle>The Book of Dojo</H2>
<DIV class=3Dcontent>
<UL class=3Dmenu>
  <LI class=3Dexpanded id=3Dmenu-item-296><A=20
  href=3D"http://dojotoolkit.org/book/dojo-book-0-9-0">The Book of =
Dojo</A>=20
  <UL class=3Dmenu>
    <LI class=3Dleaf id=3Dmenu-item-312><A=20
    =
href=3D"http://dojotoolkit.org/book/dojo-book-0-9/part-1-life-dojo/quick-=
installation">Quick=20
    Installation</A>=20
    <LI class=3Dleaf id=3Dmenu-item-652><A=20
    =
href=3D"http://dojotoolkit.org/book/dojo-book-0-9/hello-world-tutorial">H=
ello=20
    World</A>=20
    <LI class=3Dleaf id=3Dmenu-item-651><A=20
    =
href=3D"http://dojotoolkit.org/book/book-dojo/part-4-meta-dojo-making-you=
r-dojo-code-run-faster-and-better/debugging-facilities/deb">Debugging=20
    Tutorial</A>=20
    <LI class=3Dcollapsed id=3Dmenu-item-297><A=20
    =
href=3D"http://dojotoolkit.org/book/dojo-book-0-9/introduction">Introduct=
ion</A>=20

    <LI class=3Dcollapsed id=3Dmenu-item-324><A=20
    =
href=3D"http://dojotoolkit.org/book/dojo-book-0-9/part-1-life-dojo-0">Par=
t 1:=20
    Life With Dojo</A>=20
    <LI class=3Dcollapsed id=3Dmenu-item-298><A=20
    =
href=3D"http://dojotoolkit.org/book/dojo-book-0-9/part-2-dijit-0">Part =
2:=20
    Dijit</A>=20
    <LI class=3Dexpanded id=3Dmenu-item-299><A class=3Dactive=20
    =
href=3D"http://dojotoolkit.org/book/dojo-book-0-9/part-3-programmatic-dij=
it-and-dojo-0">Part=20
    3: JavaScript With Dojo and Dijit</A>=20
    <UL class=3Dmenu>
      <LI class=3Dcollapsed id=3Dmenu-item-335><A=20
      =
href=3D"http://dojotoolkit.org/book/dojo-book-0-9/part-3-programmatic-dij=
it-and-dojo/functions-used-everywhere">Functions=20
      Used Everywhere</A>=20
      <LI class=3Dcollapsed id=3Dmenu-item-343><A=20
      =
href=3D"http://dojotoolkit.org/book/dojo-book-0-9/part-3-programmatic-dij=
it-and-dojo/object-orientation">Object=20
      Orientation</A>=20
      <LI class=3Dcollapsed id=3Dmenu-item-491><A=20
      =
href=3D"http://dojotoolkit.org/book/dojo-book-0-9/part-3-programmatic-dij=
it-and-dojo/modules-and-namespaces">Modules</A>=20

      <LI class=3Dcollapsed id=3Dmenu-item-354><A=20
      =
href=3D"http://dojotoolkit.org/book/dojo-book-0-9/part-3-programmatic-dij=
it-and-dojo/manipulating-widgets-through-code">Manipulating=20
      Widgets Through Code</A>=20
      <LI class=3Dcollapsed id=3Dmenu-item-364><A=20
      =
href=3D"http://dojotoolkit.org/book/dojo-book-0-9/part-3-programmatic-dij=
it-and-dojo/manipulating-widgets-through-code/writing-your">Writing=20
      Your Own Widget Class</A>=20
      <LI class=3Dcollapsed id=3Dmenu-item-351><A=20
      =
href=3D"http://dojotoolkit.org/book/dojo-book-0-9/part-3-programmatic-dij=
it-and-dojo/event-system">The=20
      Event System</A>=20
      <LI class=3Dcollapsed id=3Dmenu-item-311><A=20
      =
href=3D"http://dojotoolkit.org/book/dojo-book-0-9/part-3-programmatic-dij=
it-and-dojo/ajax-transports">XMLHttpRequest=20
      (XHR)</A>=20
      <LI class=3Dcollapsed id=3Dmenu-item-356><A=20
      =
href=3D"http://dojotoolkit.org/book/dojo-book-0-9/part-3-programmatic-dij=
it-and-dojo/drag-and-drop">Drag=20
      and Drop</A>=20
      <LI class=3Dcollapsed id=3Dmenu-item-357><A=20
      =
href=3D"http://dojotoolkit.org/book/dojo-book-0-9/part-3-programmatic-dij=
it-and-dojo/data-retrieval-dojo-data-0">Using=20
      dojo.data</A>=20
      <LI class=3Dcollapsed id=3Dmenu-item-360><A=20
      =
href=3D"http://dojotoolkit.org/book/dojo-book-0-9/part-3-programmatic-dij=
it-and-dojo/selecting-dom-nodes-dojo-query">Selecting=20
      DOM Nodes with dojo.query</A>=20
      <LI class=3Dcollapsed id=3Dmenu-item-361><A=20
      =
href=3D"http://dojotoolkit.org/book/dojo-book-0-9/part-3-programmatic-dij=
it-and-dojo/i18n">i18n</A>=20

      <LI class=3Dcollapsed id=3Dmenu-item-359><A=20
      =
href=3D"http://dojotoolkit.org/book/dojo-book-0-9/part-3-programmatic-dij=
it-and-dojo/back-button-undo">Back=20
      Button</A>=20
      <LI class=3Dcollapsed id=3Dmenu-item-362><A=20
      =
href=3D"http://dojotoolkit.org/book/dojo-book-0-9/part-3-programmatic-dij=
it-and-dojo/other-miscellaneous-function">Other=20
      Functions</A> </LI></UL>
    <LI class=3Dcollapsed id=3Dmenu-item-300><A=20
    =
href=3D"http://dojotoolkit.org/book/dojo-book-0-9/part-4-meta-dojo-0">Par=
t 4:=20
    Testing, Tuning and Debugging</A>=20
    <LI class=3Dcollapsed id=3Dmenu-item-301><A=20
    =
href=3D"http://dojotoolkit.org/book/dojo-book-0-9/part-5-dojox-extensions=
-dojo-0">Part=20
    5: DojoX</A> </LI></UL>
  <LI class=3Dcollapsed id=3Dmenu-item-54><A title=3D"The Dojo Book, =
0.4"=20
  href=3D"http://dojotoolkit.org/book/dojo-book-0-4">The Dojo Book, =
0.4</A>=20
</LI></UL></DIV></DIV></DIV></DIV>
<DIV class=3D"col-b content-region-container">
<DIV id=3Dmain-container><!-- main_content region -->
<H2>Part 3: JavaScript Programming With Dojo and Dijit</H2><!--Node: -->
<DIV class=3Dnode>
<DIV class=3Dsubmitted>Submitted by criecke on Sat, 04/28/2007 - =
19:23.</DIV>
<DIV class=3Dcontent>
<P>In addition to being useful in itself, Dijit is a testament to Dojo's =

solidness and performance. The fact that you can build a really nice, =
extensible=20
widget framework on top of it shows how cool Dojo is.</P>
<P>But that's only the beginning. Other Dojo-based mini-frameworks like=20
dojo.data and dojox.offline allow you to build data sources and offline =
storage,=20
respectively, in object oriented fashion. With a bit of JavaScript, you =
can use=20
these services and many others bundled with Dojo for your own Web 2.0=20
applications:</P>
<UL>
  <LI><B>Object Oriented Class Helpers</B> - JavaScript uses =
prototype-based,=20
  not class-based, object orientation natively.&nbsp; Dojo essentially =
builds a=20
  class system on top, adding great features like inheritance, =
encapsulation,=20
  mixin classes, and more.&nbsp; This will make Java and C# programmers =
feel at=20
  home, and help build solid Enterprise-level applications.
  <LI><B>Modules</B> - As your client code grows, it's harder to keep =
all=20
  functions and global variables from using the same name and wrecking =
each=20
  other.&nbsp; Dojo adds a module system on top of JavaScript as part of =
its=20
  class layer.&nbsp; Modules are like packages in Java.
  <LI><B>Dijit Methods</B> - As we've seen, you can create Dijit =
components=20
  programmatically - perfect for when you need 1000 tree nodes, for=20
  example.&nbsp; You can also build your own Dijit widget classes, and =
extend=20
  the ones already there.
  <LI><B>Events</B> - Dojo generalizes the event system already present =
in=20
  JavaScript.&nbsp; You can connect events to code, and the resulting =
app works=20
  in Firefox, IE, and Safari without modification.&nbsp; It also =
introduces=20
  "double-blind" publish/subscribe events - perfect for loosely-coupled =
code.
  <LI><B>XHR (Ajax)</B> - Dojo adds a nice wrapper around native =
XmlHttpRequest=20
  services.&nbsp; Often you can boil an XHR message-pass with one =
function=20
  call.&nbsp; The data is given to you in text, XML, or in a JavaScript =
object=20
  via JSON.&nbsp;=20
  <LI><B>Drag and Drop</B> - Often the bane of DHTML applications, drag =
and drop=20
  services are essential for easy user interaction.&nbsp; Dojo's DnD =
layer is=20
  fast, cross-platform, and very straightforward.
  <LI><B>Dojo.data</B> - The Data module is an abstraction layer that =
makes=20
  gathering data from outside sources consistent.&nbsp; Reading from a =
database=20
  or web service uses the same base calls.&nbsp; You can write pluggable =
data=20
  modules for your own sources.
  <LI><B>Dojo.query</B> - Finding and manipulating HTML fragments is=20
  difficult.&nbsp; But Dojo.query makes it as easy as CSS.&nbsp; You can =
write=20
  sophsticated selectors, then apply an operation to all of them in one =
step.
  <LI><B>i18n</B> - Short for "Internationalization" ("i", "n" and the =
18=20
  characters between them), Dojo i18n services help make all of your =
code=20
  globally accessible with understandable date, number and currency =
formats, and=20
  translated resource bundles.=20
  <LI><B>Back button handling</B> - dojo.back saves your application =
from=20
  nervous users trying to use the Back button. One-page apps can destroy =
data at=20
  one touch of the back button. dojo.back alters the behavior of Back to =
make it=20
  less likely.=20
  <LI><B>And more, more more!</B> - As your apps get sophsiticated, you =
can also=20
  write them compactly using Dojo's language extension features, HTML =
style=20
  functions, cookie functions, and much more! </LI></UL>
<DIV class=3Dbook-navigation>
<UL class=3Dmenu>
  <LI class=3Dcollapsed><A=20
  =
href=3D"http://dojotoolkit.org/book/dojo-book-0-9/part-3-programmatic-dij=
it-and-dojo/functions-used-everywhere">Functions=20
  Used Everywhere</A>
  <LI class=3Dcollapsed><A=20
  =
href=3D"http://dojotoolkit.org/book/dojo-book-0-9/part-3-programmatic-dij=
it-and-dojo/object-orientation">Object=20
  Orientation</A>
  <LI class=3Dcollapsed><A=20
  =
href=3D"http://dojotoolkit.org/book/dojo-book-0-9/part-3-programmatic-dij=
it-and-dojo/modules-and-namespaces">Modules</A>
  <LI class=3Dcollapsed><A=20
  =
href=3D"http://dojotoolkit.org/book/dojo-book-0-9/part-3-programmatic-dij=
it-and-dojo/manipulating-widgets-through-code">Manipulating=20

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -