計(jì)算機(jī)程序虛擬的人生
          虛擬世界中的游魂
           Dojo介紹
                 Dojo 是一個(gè)用javascript語言實(shí)現(xiàn)的開源DHTML工具包。它是在幾個(gè)項(xiàng)目捐助基礎(chǔ)上建立起來的(nWidgets, Burstlib, f(m)), 這也是為什么叫它a \"unified\" toolkit的原因。Dojo的目標(biāo)是解決開發(fā)DHTML應(yīng)用程序遇到的那些,長期存在 、歷史問題。historical problems with DHTML 跨瀏覽器問題。Dojo讓你更容易 使web頁面具有動(dòng)態(tài)能力,或在任何穩(wěn)健的支持javascript語言的環(huán)境中發(fā)揮作用。

          a、利用dojo提供的組件,你可以提升你的web應(yīng)用程序可用性、交互能力以及功能上的提高;
          b、你也可以 更容易的建立degradeable user interfaces ??,dojo提供小巧的 widgets ,animate transitions;
          c、利用它的低級APIs和可兼容的代碼,寫出輕便的、單一風(fēng)格(復(fù)雜)的javascript代碼,Dojo的 event system, I/O APIs, and generic language enhancement form the basis of a powerful programming environment.
          d、通過Dojo提供的工具,你可以為你的代碼寫命令行式的單元測試代碼。
          e、the Dojo package system使你自己的代碼更容易維護(hù),偶合性更低。

          Dojo通過很少的代碼完成了以上的功能。(以后可能我詳細(xì)說說dojo的package system ,只需要三個(gè)js文件)。當(dāng)你寫腳本時(shí),只需要包含很少的js文件(大小)。也可以選擇的(包含)下載dojo提供的龐大的功能。Dojo provides MultiplePointsOfEntry, InterpreterIndependence, ForwardLookingAPIs, and focuses on ReducingBarriersToAdoption.
            dojo試圖建立一種新的標(biāo)簽語言DojoML。目標(biāo)是,在DojoML和javascript腳本語言不變的情況下,用不同的render方式展示數(shù)據(jù), Renderings may be made available in several rendering contexts (such as SVG, or perhaps even the desktop or Flash)。(比較美好啊)更進(jìn)一步,the DojoML 剖析器可以接受html和svg為輸入,容易的建立DegradeableResponsiveApplications。

          第一部分  安裝
          第一個(gè)小節(jié)  怎么安裝Dojo Toolkit
           Dojo在磁盤上只是一堆文件,它不需要特殊的設(shè)置,它可以通過以下三種途徑獲得:
           1、可以從google的內(nèi)容分布網(wǎng)絡(luò)獲得
             加載的方法可以參考http://code.google.com/intl/zh-CN/apis/ajaxlibs/documentation/index.html#dojo
           2、.在你自己的服務(wù)器上使用Dojo
            a、下載最新的dojo包,地址:http://dojotoolkit.org/downloads;目前最新的包為1.3.1
            b、解壓下載的壓縮文件
                   --dojo-release-1.3.1-src
                      ----dijit
                      ----dojo
                      ----dojox
                      ----util
            c、可以通過D:\Apache-Source\dojo\1.3.1\dojo-release-1.3.1-src\dojo-release-1.3.1-src\dijit\themes\themeTester.html 這樣的路徑來查看相關(guān)的JS例子
          3、每日構(gòu)建代碼
             你可以通過SVN地址獲得
          For instance, Dojo Core repository is:
          http://svn.dojotoolkit.org/src/dojo/trunk

          There are two versions of this view: anonymous and committer.

          For users (readonly):
          http://svn.dojotoolkit.org/src/view/anon/all/trunk

          For committers (read/write):
          https://svn.dojotoolkit.org/src/view/committer/all/trunk

          第二部分 Ajax
          第一個(gè)小節(jié) ajax
          a、ajax and Dojo
          1)XHR選項(xiàng)
          例子:

          // post some data, ignore the response:
          dojo.xhrPost({
          form: "someFormId", // read the url: from the action="" of the <form>
          timeout: 3000, // give up after 3 seconds
          content: { part:"one", another:"part" } // creates ?part=one&another=part with GET, Sent as POST data when using xhrPost
          });
          // get some data, convert to JSON
          dojo.xhrGet({
          url:"data.json",
          handleAs:"json",
          load: function(data){
          for(var i in data){
          console.log("key", i, "value", data[i]);
          }
          }
          });
          

          2)XHR回調(diào)
          有三種方法可以附加到XHR選擇對象,以確定當(dāng)數(shù)據(jù)回調(diào)時(shí)該怎么做。


          posted on 2009-06-29 14:20 小兄弟(Robbins) 閱讀(379) 評論(0)  編輯  收藏

          只有注冊用戶登錄后才能發(fā)表評論。


          網(wǎng)站導(dǎo)航:
           
           
          主站蜘蛛池模板: 滨海县| 株洲市| 克什克腾旗| 略阳县| 兰西县| 南江县| 郑州市| 宁波市| 青田县| 海晏县| 通江县| 健康| 台湾省| 伊吾县| 阿荣旗| 鲜城| 米脂县| 冷水江市| 遵义县| 甘孜县| 华坪县| 焦作市| 龙游县| 尚志市| 曲周县| 湖北省| 遂川县| 吉木萨尔县| 呼伦贝尔市| 图们市| 西宁市| 台州市| 东兰县| 墨竹工卡县| 如皋市| 乐山市| 温泉县| 临海市| 滁州市| 沂南县| 临朐县|