<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    隨筆 - 303  文章 - 883  trackbacks - 0
    <2008年2月>
    272829303112
    3456789
    10111213141516
    17181920212223
    2425262728291
    2345678

    歡迎光臨! 
    閑聊 QQ:1074961813

    隨筆分類(357)

    我管理的群

    公共blog

    • n維空間
    • Email : java3d@126.com 群 : 12999758

    參與管理的論壇

    好友的blog

    我的其他blog

    朋友的網(wǎng)站

    搜索

    •  

    最新評論

    大家都清楚web2.0與ajax的出現(xiàn),給web用戶帶來巨大的感管與心理沖擊,那些討厭的頁面跳轉(zhuǎn)不見了;菜單一奇特的方式出現(xiàn),又神奇的消失;可愛的界面讓我愛上它;用戶一下子從web世界回到桌面程序世界。
    一切來得太快了,程序員紛紛開始學(xué)習(xí)js,css,就在這個時候,一大堆的Ajax框架出現(xiàn)了,DWR似乎是目前比較常見的Ajax框架之一。
    另一個優(yōu)秀的框架引起我尋某人的注意,界面方面他一點也不比DWR,只是在框架的組織上更為簡單。





    此刻,就讓我們一起來玩玩他吧!

    首先,到官方http://dojotoolkit.org/ 下載安裝包。地址: http://dojotoolkit.org/downloads 
     


    接著,打開myeclipse,將他復(fù)制到一個新建的web project中



    圖中選中部分為剛下載的dojo程序包
    如果顯示一個紅色的*錯誤,打開那個文件做小小修改,比如<br>改成<p>

    接下來新建一個html頁面index1.html,在里面寫入
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
            "http://www.w3.org/TR/html4/strict.dtd"
    >
    <html>
        
    <head>
            
    <title>Dojo Form Widgets Test</title>

            
    <script type="text/javascript" src="js/dojo/dojo/dojo.js"
                djConfig
    ="isDebug: false, parseOnLoad: true"></script>
            
    <script type="text/javascript">
                dojo.require(
    "dijit.form.Form");
                dojo.require(
    "dijit.form.ValidationTextBox");
                dojo.require(
    "dijit.form.ComboBox");
                dojo.require(
    "dijit.form.FilteringSelect");
                dojo.require(
    "dijit.form.CheckBox");
                dojo.require(
    "dijit.form.DateTextBox");
                dojo.require(
    "dijit.form.CurrencyTextBox");
                dojo.require(
    "dijit.form.NumberSpinner");
                dojo.require(
    "dijit.form.Slider");
                dojo.require(
    "dijit.form.Textarea");
                dojo.require(
    "dijit.Editor");
                dojo.require(
    "dijit.form.Button");
                dojo.require(
    "dojo.data.ItemFileReadStore");
                dojo.require(
    "dojo.parser");    // scan page for widgets and instantiate them

                
    // make dojo.toJson() print dates correctly (this feels a bit dirty)
                Date.prototype.json = function()return dojo.date.stamp.toISOString(this{selector: 'date'});};
            
    </script>
            
    <style type="text/css">
                @import "js/dojo/dojo/resources/dojo.css";
                @import "js/dojo/dijit/themes/tundra/tundra.css";
                @import "js/dojo/dijit/themes/tundra/tundra_rtl.css";
                @import "js/dojo/dijit/tests/css/dijitTests.css";

                .formQuestion 
    {
                    background-color
    :#d0e3f5;
                    padding
    :0.3em;
                    font-weight
    :900;
                    font-family
    :Verdana, Arial, sans-serif;
                    font-size
    :0.8em;
                    color
    :#5a5a5a;
                
    }

                .formAnswer 
    {
                    background-color
    :#f5eede;
                    padding
    :0.3em;
                    margin-bottom
    :1em;
                    width
    : 100%;
                
    }

                .pageSubContentTitle 
    {
                        color
    :#8e8e8e;
                        font-size
    :1em;
                        font-family
    :Verdana, Arial, sans-serif;
                        margin-bottom
    :0.75em;
                
    }

                .small INPUT 
    {
                    width
    : 2.5em;
                
    }

                .medium INPUT 
    {
                    width
    : 10em;
                
    }

                .long INPUT 
    {
                    width
    : 20em;
                
    }

                .firstLabel 
    {
                    display
    : inline-block;
                    display
    : -moz-inline-box;
                    width
    : 10em;
                    min-width
    : 10em;
                
    }

                .secondLabel 
    {
                    width
    : auto;
                    margin-left
    : 5em;
                    margin-right
    : 1em;
                
    }

                fieldset label 
    {
                    margin-right
    : 1em;
                
    }

                .noticeMessage 
    {
                    display
    : block;
                    float
    : right;
                    font-weight
    : normal;
                    font-family
    :Arial, Verdana, sans-serif;
                    color
    :#663;
                    font-size
    :0.9em;
                
    }

            
    </style>
        
    </head>
        
    <body class="tundra">
            
    <div dojoType="dojo.data.ItemFileReadStore" jsId="stateStore"
                url
    ="js/dojo/dijit/tests/_data/states.json"></div>

            
    <h2 class="pageSubContentTitle">Job Application Form</h2>
            
    <p>This is just a little demo of dijit's form widgets</p>
            
    <form dojoType="dijit.form.Form" id="myForm" action="showPost.php"
                execute
    ="alert('Execute form w/values:\n'+dojo.toJson(arguments[0],true));">
                
    <div class="formQuestion">
                    
    <span class="noticeMessage">
                        As you type in the text below, notice how your input is auto
                        corrected and also the auto completion on the state field.
                    
    </span>
                    
    <span>Name And Address</span>
                
    </div>
                
    <div class="formAnswer">
                    
    <label class="firstLabel" for="name">Name *</label>
                    
    <input type="text" id="name" name="name" class="medium"
                        dojoType
    ="dijit.form.ValidationTextBox"
                        required
    ="true" 
                        ucfirst
    ="true" invalidMessage=""/>
                    
    <br>

                    
    <label class="firstLabel" for="address">Address *</label>
                    
    <input type="text" id="address" name="address" class="long"
                        dojoType
    ="dijit.form.ValidationTextBox"
                        required
    ="true"
                        trim
    ="true" 
                        ucfirst
    ="true" />
                    
    <br>

                    
    <label class="firstLabel" for="city">City *</label>
                     
    <select dojoType="dijit.form.ComboBox"
                             value
    =""
                            autocomplete
    ="true"
                            hasDownArrow
    ="false"
                    
    >
                        
    <option></option>
                        
    <option>Chicago</option>
                        
    <option>Los Angeles</option>
                        
    <option>New York</option>
                        
    <option>San Francisco</option>
                        
    <option>Seattle</option>
                    
    </select>

                    
    <label class="secondLabel" for="state">State</label>
                    
    <input dojoType="dijit.form.FilteringSelect"
                        store
    ="stateStore" class="short" id="state" name="state" />

                    
    <label class="secondLabel" for="zip">Zip *</label>
                    
    <input type="text" id="zip" name="zip" class="medium"
                        dojoType
    ="dijit.form.ValidationTextBox"
                        trim
    ="true" 
                        required
    ="true"
                        regExp
    ="[0-9][0-9][0-9][0-9][0-9]"
                        invalidMessage
    ="5 digit zipcode (ex: 23245)"/>
                    
    <br>

                    
    <label class="firstLabel" for="dob">DOB *</label>
                    
    <input id="dob" name="dateOfBirth" dojoType="dijit.form.DateTextBox" required=true/>
                    
                
    </div>

                
    <div class="formQuestion">
                    
    <span class="noticeMessage">Custom checkboxes and radio buttons</span>
                    
    <span>Desired position</span>
                
    </div>
                
    <div class="formAnswer">
                    
    <label class="firstLabel" for="position">Position</label>
                    
    <fieldset id="position" class="dijitInline">
                        
    <input type="checkBox" name="position" id="it" value="it" dojoType="dijit.form.CheckBox" /> <label for="it">IT</label>
                        
    <input type="checkBox" name="position" id="marketing" value="marketing" dojoType="dijit.form.CheckBox" /> <label for="marketing">Marketing</label>
                        
    <input type="checkBox" name="position" id="business" value="business" dojoType="dijit.form.CheckBox" /> <label for="business" style="margin-right: 7em;">Business</label>
                    
    </fieldset>

                    
    <label class="secondLabel" for="hours">Hours</label>
                    
    <fieldset id="hours" class="dijitInline">
                        
    <input type="radio" name="hours" id="full" value="full" dojoType="dijit.form.RadioButton" /> <label for="full">Full time</label>
                        
    <input type="radio" name="hours" id="part" value="part" dojoType="dijit.form.RadioButton" /> <label for="part">Part time</label>
                    
    </fieldset>
                
    </div>

                
    <div class="formQuestion">
                    
    <span class="noticeMessage">slider and spinner </span>
                    
    <span>Education and Experience</span>
                
    </div>
                
    <div class="formAnswer">
                    
    <table class="dijitReset">
                        
    <tr>
                            
    <td>
                                
    <label class="firstLabel" for="school">Education level</label>
                            
    </td>
                            
    <td style="padding-left: 2em;">
                                
    <span dojoType="dijit.form.HorizontalSlider" id="school" name="school"
                                    minimum
    ="1"
                                    value
    ="2"
                                    maximum
    ="4"
                                    discreteValues
    ="4"
                                    showButtons
    ="false"
                                    style
    ="width:200px; height: 40px;"
                                
    >
                                        
    <span dojoType="dijit.form.HorizontalRule" container="bottomDecoration" count=4 style="height:5px;"></span>
                                        
    <ol dojoType="dijit.form.HorizontalRuleLabels" container="bottomDecoration"style="height:1em;font-size:75%;color:gray;">
                                            
    <li>high school</li>
                                            
    <li>college</li>
                                            
    <li>masters</li>
                                            
    <li>PhD</li>
                                        
    </ol>
                                
    </span>
                            
    </td>
                            
    <td>
                                
    <label class="secondLabel" for="experience">Work experience (years, 0-40)</label>
                            
    </td>
                            
    <td>
                                
    <input dojoType="dijit.form.NumberSpinner"
                                    id
    ="experience" name="experience"
                                    value
    ="1"
                                    constraints
    ="{min: 0, max:40, places:0}"
                                    size
    =3>
                            
    </td>
                        
    </tr>
                    
    </table>
                
    </div>

                
    <div class="formQuestion">
                    
    <span class="noticeMessage">Rich text editor that expands as you type in text</span>
                    
    <label for="description">Self description</label>
                
    </div>
                
    <div class="formAnswer">
                    
    <textarea dojoType="dijit.Editor" minHeight="5em" id="description" name="description">
                    Write a brief summary of 
    &lt;i&gt;your&lt;/i&gt; job skills using &lt;b&gt;rich&lt;/b&gt; text.
                    
    </textarea>
                
    </div>
                
                
    <div class="formQuestion">
                    
    <span class="noticeMessage">Text area that expands as you type in text</span>
                    
    <label for="references">References</label>
                
    </div>
                
    <div class="formAnswer">
                    
    <textarea dojoType="dijit.form.Textarea" id="references" name="references">
                        Write your references here (plain text)
                    
    </textarea>
                
    </div>

                  
    <center>
                    
    <button dojoType="dijit.form.Button" iconClass="dijitEditorIcon dijitEditorIconSave" type=submit>
                        OK
                    
    </button>
                
    </center>
            
    </form>
        
    </body>
    </html>

    該程序來自,\js\dojo\dijit\demos\i18n.html 后被我做過小小修改。
    其次,你可以http://127.0.0.1:8080/pojo/js/dojo/dijit/themes/themeTester.html
    通過這個地址看到一些不錯的實例

    就帶你到這里,接下來自己玩吧!

    地震讓大伙知道:居安思危,才是生存之道。
    posted on 2008-02-14 10:39 小尋 閱讀(2525) 評論(1)  編輯  收藏 所屬分類: Ajax、Flex

    FeedBack:
    # re: 初嘗Ajax框架DOJO禁果 2008-07-09 20:45 pire_cao
    我也在研究dojo,可以加我MSN:pire_cao@hotmail.com  回復(fù)  更多評論
      
    主站蜘蛛池模板: 亚洲aⅴ无码专区在线观看| 亚洲一级高清在线中文字幕| 国产天堂亚洲国产碰碰| 在线观看av永久免费| 亚洲国产人成在线观看| 国产卡一卡二卡三免费入口| 亚洲精品国产肉丝袜久久| 3d成人免费动漫在线观看| 久久亚洲国产精品成人AV秋霞| 免费无码成人AV在线播放不卡 | 亚洲精品无码不卡在线播放| 黄页网站免费在线观看| 亚洲AV成人影视在线观看| 成年18网站免费视频网站| 国产成人高清亚洲一区91| 亚洲国产精品13p| 国产真人无码作爱视频免费| 亚洲精品日韩中文字幕久久久| 免费看国产精品3a黄的视频 | 色噜噜狠狠色综合免费视频 | 亚洲精品线在线观看| 毛片免费全部播放无码| 中文字幕亚洲码在线| 免费大片在线观看网站| 三级黄色免费观看| 亚洲成人高清在线观看| 日本19禁啪啪无遮挡免费动图| 免费看一级高潮毛片| 亚洲成色在线综合网站 | 成人免费激情视频| 亚洲高清国产拍精品熟女| 亚洲精品乱码久久久久久不卡| 久久久久国产免费| 亚洲熟妇少妇任你躁在线观看| 亚洲精品视频在线观看你懂的| 免费女人高潮流视频在线观看| 亚洲精品人成网线在线播放va| 亚洲中文字幕久久精品无码喷水| 亚洲毛片免费视频| 免费一级毛片在线播放放视频| 亚洲美女aⅴ久久久91|