亚洲天堂男人影院,亚洲真人无码永久在线,亚洲男女内射在线播放http://www.tkk7.com/vesung/category/28849.html@author<a href='mailto:vesung@gmail.com'>wangjing</a><br><br><a ><span style='color:#E32202;font-size:23px;'><b>我的求職簡歷</b></span></a>zh-cnTue, 25 Mar 2008 00:26:15 GMTTue, 25 Mar 2008 00:26:15 GMT60jQeury中獲取dom元素的幾種方式-$(selector)、$()示例http://www.tkk7.com/vesung/archive/2008/03/24/188315.htmlwangjingwangjingMon, 24 Mar 2008 09:53:00 GMThttp://www.tkk7.com/vesung/archive/2008/03/24/188315.htmlhttp://www.tkk7.com/vesung/comments/188315.htmlhttp://www.tkk7.com/vesung/archive/2008/03/24/188315.html#Feedback0http://www.tkk7.com/vesung/comments/commentRss/188315.htmlhttp://www.tkk7.com/vesung/services/trackbacks/188315.html     獲取元素id為idName的元素 
 如:html
<a id="myLinck" href="#"></a>
$("#myLinck") 會返回<a id="myLinck"></a>元素
-----------------------------------
2.$(".className")
    獲取元素class屬性為className的元素集合
如:html
<a class="a1" href="#">1</a>
<a class="a1" href="#">2</a>
<a class="a2" href="#">3</a>
$(".a1")返回[<a class="a1" href="#">1</a>,<a class="a1" href="#">2</a>]
---------------------------------------
3.$("input[@type='text']")
    獲取所有type=text的input元素
如:html
<input type='text'/>
<input type='text/>
<input type='checkbox'/>
$("input[@type='text']")返回[<input type='text'/><input type='text/>]


wangjing 2008-03-24 17:53 發(fā)表評論
]]>
jQuery對象與dom對象的區(qū)別http://www.tkk7.com/vesung/archive/2008/03/24/188311.htmlwangjingwangjingMon, 24 Mar 2008 09:38:00 GMThttp://www.tkk7.com/vesung/archive/2008/03/24/188311.htmlhttp://www.tkk7.com/vesung/comments/188311.htmlhttp://www.tkk7.com/vesung/archive/2008/03/24/188311.html#Feedback0http://www.tkk7.com/vesung/comments/commentRss/188311.htmlhttp://www.tkk7.com/vesung/services/trackbacks/188311.html普通的dom對象一般可以通過$()轉(zhuǎn)換成jquery對象。
如:$(document.getElementById("msg"))則為jquery對象,可以使用jquery的方法。
由于jquery對象本身是一個集合。所以如果jquery對象要轉(zhuǎn)換為dom對象則必須取出其中的某一項(xiàng),一般可通過索引取出。
如:$("#msg")[0],$("div").eq(1)[0],$("div").get()[1],$("td")[5]這些都是dom對象,可以使用dom中的方法,但不能再使用Jquery的方法。
以下幾種寫法都是正確的: 字串8

$("#msg").html();
$("#msg")[0].innerHTML;
$("#msg").eq(0)[0].innerHTML;
$("#msg").get(0).innerHTML;



wangjing 2008-03-24 17:38 發(fā)表評論
]]>
Ajax.Request詳解-prototype相關(guān)http://www.tkk7.com/vesung/archive/2008/03/21/187753.htmlwangjingwangjingFri, 21 Mar 2008 09:45:00 GMThttp://www.tkk7.com/vesung/archive/2008/03/21/187753.htmlhttp://www.tkk7.com/vesung/comments/187753.htmlhttp://www.tkk7.com/vesung/archive/2008/03/21/187753.html#Feedback0http://www.tkk7.com/vesung/comments/commentRss/187753.htmlhttp://www.tkk7.com/vesung/services/trackbacks/187753.html為了支持 AJAX 功能。這個包定義了 Ajax.Request 類。

假如你有一個應(yīng)用程序可以通過url http://yoursever/app/get_sales?empID=1234&year=1998與服務(wù)器通信。它返回下面這樣的XML 響應(yīng)。

 

 

<?xml version="1.0" encoding="utf-8" ?>
<ajax-response>
    
<response type="object" id="productDetails">
        
<monthly-sales>
            
<employee-sales>
                
<employee-id>1234</employee-id>
                
<year-month>1998-01</year-month>
                
<sales>$8,115.36</sales>
            
</employee-sales>
            
<employee-sales>
                
<employee-id>1234</employee-id>
                
<year-month>1998-02</year-month>
                
<sales>$11,147.51</sales>
            
</employee-sales>
        
</monthly-sales>
    
</response>
</ajax-response>

 

Ajax.Request對象和服務(wù)器通信并且得到這段XML是非常簡單的。下面的例子演示了它是如何完成的。

 

<script>
    
function searchSales()
    
{
        
var empID = $F('lstEmployees');
        
var y = $F('lstYears');
        
var url = 'http://yoursever/app/get_sales';
        var pars = 'empID=+ empID + '&year=+ y;
       
var myAjax = new Ajax.Request(
                    url,
                    
{method: 'get', parameters: pars, onComplete: showResponse}
                    );

    }


    
function showResponse(originalRequest)
    
{
        
//put returned XML in the textarea
        $('result').value = originalRequest.responseText;
    }

</script>

<select id="lstEmployees" size="10" onchange="searchSales()">
    
<option value="5">Buchanan, Steven</option>
    
<option value="8">Callahan, Laura</option>
    
<option value="1">Davolio, Nancy</option>
</select>
<select id="lstYears" size="3" onchange="searchSales()">
    
<option selected="selected" value="1996">1996</option>
    
<option value="1997">1997</option>
    
<option value="1998">1998</option>
</select>
<br><textarea id=result cols=60 rows=10 ></textarea>


你看到傳入 Ajax.Request構(gòu)造方法的第二個對象了嗎? 參數(shù){method: 'get', parameters: pars, onComplete: showResponse} 表示一個匿名對象的真實(shí)寫法。他表示你傳入的這個對象有一個名為 method 值為 'get'的屬性,另一個屬性名為 parameters 包含HTTP請求的查詢字符串,和一個onComplete 屬性/方法包含函數(shù)showResponse

還有一些其它的屬性可以在這個對象里面定義和設(shè)置,如 asynchronous,可以為truefalse 來決定AJAX對服務(wù)器的調(diào)用是否是異步的(默認(rèn)值是 true)。

這個參數(shù)定義AJAX調(diào)用的選項(xiàng)。在我們的例子中,在第一個參數(shù)通過HTTP GET命令請求那個url,傳入了變量 pars包含的查詢字符串, Ajax.Request 對象在它完成接收響應(yīng)的時候?qū)⒄{(diào)用showResponse 方法。

也許你知道, XMLHttpRequest在HTTP請求期間將報告進(jìn)度情況。這個進(jìn)度被描述為四個不同階段:Loading, Loaded, Interactive, 或 Complete。你可以使 Ajax.Request 對象在任何階段調(diào)用自定義方法 ,Complete 是最常用的一個。想調(diào)用自定義的方法只需要簡單的在請求的選項(xiàng)參數(shù)中的名為 onXXXXX 屬性/方法中提供自定義的方法對象。 就像我們例子中的 onComplete 。你傳入的方法將會被用一個參數(shù)調(diào)用,這個參數(shù)是 XMLHttpRequest 對象自己。你將會用這個對象去得到返回的數(shù)據(jù)并且或許檢查包含有在這次調(diào)用中的HTTP結(jié)果代碼的 status 屬性。

還有另外兩個有用的選項(xiàng)用來處理結(jié)果。我們可以在onSuccess 選項(xiàng)處傳入一個方法,當(dāng)AJAX無誤的執(zhí)行完后調(diào)用, 相反的,也可以在onFailure選項(xiàng)處傳入一個方法,當(dāng)服務(wù)器端出現(xiàn)錯誤時調(diào)用。正如onXXXXX 選項(xiàng)傳入的方法一樣,這兩個在被調(diào)用的時候也傳入一個帶有AJAX請求的XMLHttpRequest對象。

我們的例子沒有用任何有趣的方式處理這個 XML響應(yīng), 我們只是把這段XML放進(jìn)了一個文本域里面。對這個響應(yīng)的一個典型的應(yīng)用很可能就是找到其中的想要的信息,然后更新頁面中的某些元素, 或者甚至可能做某些XSLT轉(zhuǎn)換而在頁面中產(chǎn)生一些HTML。
完。
摘自:https://compdoc2cn.dev.java.net



wangjing 2008-03-21 17:45 發(fā)表評論
]]>
帶有添加刪除行功能的表格(ajax/javascript/js實(shí)現(xiàn))http://www.tkk7.com/vesung/archive/2008/02/22/181406.htmlwangjingwangjingFri, 22 Feb 2008 06:45:00 GMThttp://www.tkk7.com/vesung/archive/2008/02/22/181406.htmlhttp://www.tkk7.com/vesung/comments/181406.htmlhttp://www.tkk7.com/vesung/archive/2008/02/22/181406.html#Feedback0http://www.tkk7.com/vesung/comments/commentRss/181406.htmlhttp://www.tkk7.com/vesung/services/trackbacks/181406.html閱讀全文

wangjing 2008-02-22 14:45 發(fā)表評論
]]>
jQuery源碼分析-構(gòu)造函數(shù)詳解http://www.tkk7.com/vesung/archive/2008/02/20/180927.htmlwangjingwangjingWed, 20 Feb 2008 10:04:00 GMThttp://www.tkk7.com/vesung/archive/2008/02/20/180927.htmlhttp://www.tkk7.com/vesung/comments/180927.htmlhttp://www.tkk7.com/vesung/archive/2008/02/20/180927.html#Feedback0http://www.tkk7.com/vesung/comments/commentRss/180927.htmlhttp://www.tkk7.com/vesung/services/trackbacks/180927.html  1、$(String expr):根據(jù)給定的CSS選擇符查找匹配的元素,如$("div>p");
  2、$(Element elem):將給定的DOM元素對象轉(zhuǎn)換為jQuery對象,如$(document).find("div>p");
  3、$(Array elems):如$(myForm.elements).hide();
  4、$(Function fn):是$(document).ready()的簡寫模式,如:$( function fn(){ ... } );
  5、$(jQuery obj):如:var div = $("div"); $(div).find("p");
  6、$(String   閱讀全文

wangjing 2008-02-20 18:04 發(fā)表評論
]]>
jQuery js框架簡介http://www.tkk7.com/vesung/archive/2008/02/20/180864.htmlwangjingwangjingWed, 20 Feb 2008 07:09:00 GMThttp://www.tkk7.com/vesung/archive/2008/02/20/180864.htmlhttp://www.tkk7.com/vesung/comments/180864.htmlhttp://www.tkk7.com/vesung/archive/2008/02/20/180864.html#Feedback0http://www.tkk7.com/vesung/comments/commentRss/180864.htmlhttp://www.tkk7.com/vesung/services/trackbacks/180864.html

wangjing 2008-02-20 15:09 發(fā)表評論
]]>
jQuery源碼詳解(轉(zhuǎn))http://www.tkk7.com/vesung/archive/2008/02/18/180415.htmlwangjingwangjingMon, 18 Feb 2008 03:46:00 GMThttp://www.tkk7.com/vesung/archive/2008/02/18/180415.htmlhttp://www.tkk7.com/vesung/comments/180415.htmlhttp://www.tkk7.com/vesung/archive/2008/02/18/180415.html#Feedback0http://www.tkk7.com/vesung/comments/commentRss/180415.htmlhttp://www.tkk7.com/vesung/services/trackbacks/180415.html以下轉(zhuǎn)自http://miokafe.com,介紹了jQuery的部分原理和實(shí)現(xiàn),對理解jQuery有很大幫助.

jQuery是個出色的javascript庫,最近結(jié)合它寫javascript,看了下源碼。

先從整體、全局的看,jQuery的源碼幾乎都在下面的代碼中:

 

(function(){

//……

}
)();

 

第一個括號里面是個匿名函數(shù),第二個括號表示馬上執(zhí)行第一個括號里面的代碼。
首先明白,javascript里面是沒有命名空間的,要保證你的javascript函數(shù)、對象與其他的不沖突,這里用了javascript的一個技巧:你的所有javascript函數(shù)、對象都在一個匿名函數(shù)里面定義,確保了所定義的函數(shù)、對象的有效范圍,起到了命名空間的作用。既然作用范圍在這個匿名函數(shù)中,怎么被別人使用呢?下面看它的下面代碼:

 

var jQuery = window.jQuery = function(selector, context) {
//……
}
;

 

這里讓jQuery庫中最重要的對象jQuery成為了window對象的一個屬性,這樣就可以在其他地方像使用document(document也是window的一個屬性)一樣使用jQuery了。也許使用過jQuery的朋友驚訝-我沒有使用jQuery對象,一直使用$的。沒錯,那是jQuery的同名對象:

window.$ = jQuery;

現(xiàn)在明白了吧。

 



wangjing 2008-02-18 11:46 發(fā)表評論
]]>
Ajax實(shí)現(xiàn)雙色表格-采用jquery實(shí)現(xiàn)http://www.tkk7.com/vesung/archive/2008/02/15/180008.htmlwangjingwangjingFri, 15 Feb 2008 01:33:00 GMThttp://www.tkk7.com/vesung/archive/2008/02/15/180008.htmlhttp://www.tkk7.com/vesung/comments/180008.htmlhttp://www.tkk7.com/vesung/archive/2008/02/15/180008.html#Feedback0http://www.tkk7.com/vesung/comments/commentRss/180008.htmlhttp://www.tkk7.com/vesung/services/trackbacks/180008.html<html>
 
<head>
  
<title>Hello, Ajax world!</title>
  
<script type="text/javascript"
    src
="../js/jquery-1.2.1.pack.js"></script>
  
<script type="text/javascript">      
        $('document').ready(
function(){
            $('.stripe tr').mouseover(
function(){
                    $(
this).addClass('over');
                }).mouseout(
function(){
                    $(
this).removeClass('over');
                    });
                $(
".stripe tr:odd").addClass('alt');                    
            
            });
            
            
function showV(){
                alert($('email'));
            }
    
</script>
<style>
th 
{
        background
:#0066FF;
        color
:#FFFFFF;
        line-height
:20px;
        height
:30px;
} 
td 
{
        padding
:6px 11px;
        border-bottom
:1px solid #95bce2;
        vertical-align
:top;
        text-align
:center;
} 
td * 
{
        padding
:6px 11px;
} 
tr.alt td 
{
        background
:#ecf6fc;  /*這行將給所有的tr加上背景色*/
} 
tr.over td 
{
        background
:#bcd4ec;  /*這個將是鼠標(biāo)高亮行的背景色*/
}
 
</style>
</head>
 
<body>
<table class="stripe" width="50%" border="0" cellspacing="0" cellpadding="0"> 
<!--用class="stripe"來標(biāo)識需要使用該效果的表格-->
<thead>
  
<tr>
    
<th>姓名</th><th>年齡</th><th>QQ</th><th>Email</th>
  
</tr>
</thead>
<tbody>
  
<tr>
    
<td>鄧國梁</td>
    
<td>23</td>
    
<td>31540205</td>
    
<td>gl.deng@gmail.com</td>
  
</tr>
  
<tr>
    
<td>鄧國梁</td>
    
<td>24</td>
    
<td>31540205</td>
    
<td>s@sn.hk</td>
  
</tr>
  
<tr>
    
<td>鄧國梁</td>
    
<td>25</td>
    
<td>31540205</td>
    
<td>gl.deng@gmail.com</td>
  
</tr>
  
<tr>
    
<td>鄧國梁</td>
    
<td>26</td>
    
<td>31540205</td>
    
<td>gl.deng@gmail.com</td>
  
</tr>
  
<tr>
    
<td>鄧國梁</td>
    
<td>27</td>
    
<td>31540205</td>
    
<td>gl.deng@gmail.com</td>
  
</tr>
  
<tr>
    
<td>鄧國梁</td>
    
<td>28</td>
    
<td>31540205</td>
    
<td>gl.deng@gmail.com</td>
  
</tr>
</tbody>
</table>
</body>
</html>

jquery-1.2.1.pack.js下載地址:http://code.google.com/p/jqueryjs/downloads/detail?name=jquery-1.2.1.pack.js&can=2&q=
這個例子相當(dāng)簡單,
了解更多jquery知識請?jiān)L問這里


wangjing 2008-02-15 09:33 發(fā)表評論
]]>
Dojo API略解續(xù)http://www.tkk7.com/vesung/archive/2008/02/13/179796.htmlwangjingwangjingWed, 13 Feb 2008 09:00:00 GMThttp://www.tkk7.com/vesung/archive/2008/02/13/179796.htmlhttp://www.tkk7.com/vesung/comments/179796.htmlhttp://www.tkk7.com/vesung/archive/2008/02/13/179796.html#Feedback0http://www.tkk7.com/vesung/comments/commentRss/179796.htmlhttp://www.tkk7.com/vesung/services/trackbacks/179796.html
dojo.string.substituteParams 類似C#中的String.Format函數(shù)
%{name}要保證與傳入的對象的名稱大小寫一致,否則會出異常
Usage Example:
dojo.string.substituteParams("%{0} - %{1} - %{2}", "a", "b", "c"); //will return "a - b - c"
dojo.string.substituteParams("%{name}: %{value}", {name:"名稱",value:"值"}); //will return "名稱: 值"
dojo.string.capitalize 把每一個單詞的首字母大寫
Usage Example:
dojo.string.capitalize("show me love"); //will return "Show Me Love"
dojo.string.isBlank 判斷輸入字符串是否為空或全是空白字符,如果傳入對象為非字符串則也會返回true
Usage Example:
dojo.string.isBlank(" 1 "); //will return false
dojo.string.escape 參數(shù)1為type,可傳值為: xml/html/xhtml, sql, regexp/regex, javas cript/js cript/js, ascii
將按照所傳type對字符串進(jìn)行編碼
Usage Example:
dojo.string.escape("html", "<input type='text' value='' />"); //will return "<input
type='text' value='' />"
dojo.string.encodeAscii
dojo.string.escapeXml
dojo.string.escapeSql
dojo.string.escapeRegExp
dojo.string.escapeJavas cript
dojo.string.escapeString
這些函數(shù)也就是 dojo.string.escape 所調(diào)用的,這里無需多說
dojo.string.summary 取得輸入字符串的縮略版本
Usage Example:
dojo.string.summary("1234567890", 5); //will return "12345..."
dojo.string.endsWith 判斷輸入字符串是否以指定的字符串結(jié)尾
Usage Example:
dojo.string.endsWith("abcde", "E"); //will return false
dojo.string.endsWith("abcde", "E", true); //will return true
dojo.string.endsWithAny 判斷輸入字符串是否以指定的任意字符串結(jié)尾
Usage Example:
dojo.string.endsWithAny("abcde", "E", "e"); //will return true
dojo.string.startsWith 判斷輸入字符串是否以指定的字符串開頭
Usage Example:
dojo.string.startsWith("abcde", "A"); //will return false
dojo.string.startsWith("abcde", "A", true); //will return true
dojo.string.startsWithAny 判斷輸入字符串是否以指定的任意字符串開頭
Usage Example:
dojo.string.startsWithAny("abcde", "A", "a"); //will return true
dojo.string.has 判斷輸入字符串是否含有任意指定的字符串
Usage Example:
dojo.string.has("abcde", "1", "23", "abc"); //will return true
dojo.string.normalizeNewlines 按要求轉(zhuǎn)換回車換行的格式
Usage Example:
dojo.string.normalizeNewlines("a\r\nb\r\n", "\r"); //will return "a\rb\r"
dojo.string.splitEscaped 將字符串按分隔符轉(zhuǎn)換為數(shù)組
Usage Example:
dojo.string.splitEscaped("a\\_b_c", '_'); //will return ["a\\_b", "c"]

模塊:dojo.lang.func
dojo.lang.hitch 將指定的方法掛在指定的對象下并返回該方法
Usage Example:
func = {test: function(s) {alert(s)}};
dojo.lang.mixin(func, {demo: dojo.lang.hitch(func, "test")});
func.demo("demo and test are same method");
dojo.lang.forward 返回自身對象的指定名稱的方法引用
Usage Example:
func = {test: function(s) {alert(s)}, demo: dojo.lang.forward("test")};
func.demo("demo and test are same method");
dojo.lang.curry What is curry? 請參閱這篇文章:http://www.svendtofte.com/code/curried_javas cript/
Usage Example:
function add(a, b)
{
return a + b;
}
dojo.lang.curry(null, add, 2, 3); //will return 5
dojo.lang.curry(null, add, 2)(3); //will return 5

dojo.lang.curry(null, add)(2)(3); //will return 5
dojo.lang.curry(null, add)()(2)(3); //will return 5
dojo.lang.curryArguments 與dojo.lang.curry類似,但是可以選擇忽略掉前n個參數(shù)
Usage Example:
function add(a, b)
{
return a + b;
}
dojo.lang.curryArguments(null, add, [1,2,3,4,5], 2); //will return 7 (= 3 + 4)

處理數(shù)組相關(guān)api

dojo.lang.has 判斷對象是否具有指定屬性,不過這個方法有用嗎,不如直接使用 if(name in obj)
Usage Example:
dojo.lang.has(dojo.lang, "has"); //will return true
dojo.lang.isEmpty 判斷對象或數(shù)組是否為空
Usage Example:
dojo.lang.isEmpty({a: 1}); //will return false
dojo.lang.isEmpty([]); //will return true
dojo.lang.map 調(diào)用指定的方法處理指定的數(shù)組或字符串
Usage Example:
dojo.lang.map([1,2,3,4,5], function(x) { return x * x;}); //will return [1,4,9,16,25]
dojo.lang.forEach 遍歷指定的數(shù)組或字符串,并對其中的元素調(diào)用指定的方法
Usage Example:
dojo.lang.forEach("abc", function(x) { alert(x); });
dojo.lang.every 檢查指定的數(shù)組是否全部滿足指定方法的條件
Usage Example:
dojo.lang.every([1,-2,3], function(x) { return x > 0; }); //指定的數(shù)組不是全大于0的,因此返回false
dojo.lang.some 檢查指定的數(shù)組是否部分滿足指定方法的條件
Usage Example:
dojo.lang.some([1,-2,3], function(x) { return x > 0; }); //指定的數(shù)組有大于0的元素,因此返回true
dojo.lang.filter 根據(jù)指定的方法來過濾指定的數(shù)組
Usage Example:
dojo.lang.filter([1,-2,3], function(x) { return x > 0; }); //will return [1, 3]
dojo.lang.unnest 把指定的參數(shù)或數(shù)組轉(zhuǎn)換為一維數(shù)組
Usage Example:
dojo.lang.unnest(1, 2, 3); //will return [1, 2, 3]
dojo.lang.unnest(1, [2, [3], [[[4]]]]); //will return [1, 2, 3, 4]
dojo.lang.toArray 將輸入轉(zhuǎn)換為數(shù)組
Usage Example:
function test()
{
return dojo.lang.toArray(arguments, 1);
}
test(1,2,3,4,5); //will return [2,3,4,5]


wangjing 2008-02-13 17:00 發(fā)表評論
]]>
Dojo入門教程之dojo.io.bind詳解http://www.tkk7.com/vesung/archive/2008/01/31/178708.htmlwangjingwangjingThu, 31 Jan 2008 08:52:00 GMThttp://www.tkk7.com/vesung/archive/2008/01/31/178708.htmlhttp://www.tkk7.com/vesung/comments/178708.htmlhttp://www.tkk7.com/vesung/archive/2008/01/31/178708.html#Feedback0http://www.tkk7.com/vesung/comments/commentRss/178708.htmlhttp://www.tkk7.com/vesung/services/trackbacks/178708.html閱讀全文

wangjing 2008-01-31 16:52 發(fā)表評論
]]>
Dojo入門教程 Dojo Quick Starthttp://www.tkk7.com/vesung/archive/2008/01/28/178197.htmlwangjingwangjingMon, 28 Jan 2008 07:43:00 GMThttp://www.tkk7.com/vesung/archive/2008/01/28/178197.htmlhttp://www.tkk7.com/vesung/comments/178197.htmlhttp://www.tkk7.com/vesung/archive/2008/01/28/178197.html#Feedback2http://www.tkk7.com/vesung/comments/commentRss/178197.htmlhttp://www.tkk7.com/vesung/services/trackbacks/178197.html
第一步,引入dojo.js
dojo的發(fā)行包里有4個子目錄,要引入的文件是名叫"dojo"的子目錄里的dojo.js。
假設(shè)你是這樣的目錄結(jié)構(gòu):
  閱讀全文

wangjing 2008-01-28 15:43 發(fā)表評論
]]>
Dojo API略解---Dojo各包功能說明http://www.tkk7.com/vesung/archive/2008/01/28/178134.htmlwangjingwangjingMon, 28 Jan 2008 02:29:00 GMThttp://www.tkk7.com/vesung/archive/2008/01/28/178134.htmlhttp://www.tkk7.com/vesung/comments/178134.htmlhttp://www.tkk7.com/vesung/archive/2008/01/28/178134.html#Feedback0http://www.tkk7.com/vesung/comments/commentRss/178134.htmlhttp://www.tkk7.com/vesung/services/trackbacks/178134.html
dojo.collections 很有用的集合數(shù)據(jù)結(jié)構(gòu)(List、Query、Set、Stack、Dictionary...)
dojo.crypto 實(shí)現(xiàn)加密功能的API(Blowfish、MD5、Rijndael、SHA...)
dojo.date 無須編寫丑陋的代碼來解析日期格式。
dojo.dnd 拖放功能的輔助API。
dojo.event 事件驅(qū)動的API,支持AOP開發(fā),以及主題/隊(duì)列的功能。
dojo.lfx HTML和SVG效果庫。
dojo.animation 基于Dan Pupius在動畫方面的工作(http://pupius.co.uk/js/Toolkit.Drawing.js)的動畫package(不再支持,應(yīng)首選dojo.lfx)
dojo.fx 不再支持,應(yīng)首選dojo.lfx
dojo.io 不同的IO管道。cookie、IFrame、發(fā)布/訂閱功能等等。所有神奇的Ajax工作都在這里完成。
dojo.lang 對于整個JavaScript環(huán)境進(jìn)行增強(qiáng)的功能。包括你所希望擁有的很多特征,例如mixin、基于閉包(closure)的函數(shù),以及大量的其他功能。
dojo.logging 提供日志功能的框架
dojo.math 數(shù)學(xué)函數(shù)(曲線、點(diǎn)、矩陣)
dojo.reflect 提供反射功能的函數(shù)庫
dojo.rpc 與后端服務(wù)(例如理解JSON語法的Web服務(wù))進(jìn)行通信
dojo.storage 將數(shù)據(jù)保存在本地存儲中(例如,在瀏覽器中利用Flash的本地存儲來實(shí)現(xiàn))
dojo.string 現(xiàn)在你可以對字符串進(jìn)行如下的處理,修整、轉(zhuǎn)換為大寫、編碼、esacpe、填充(pad)等等。
dojo.undo 用來撤銷用戶操作的棧管理器
dojo.uri 處理URI的函數(shù)庫
dojo.widget 一個widget框架,允許你建造可重用的HTML/JavaScript widget,可以與簡單的HTML標(biāo)記共同使用(例如,<div class=”dojo-MyWidgetType”>)。支持基于標(biāo)記的應(yīng)用開發(fā)(例如:XAML、XUL)
dojo.xml、dojo.dom 幫助你處理DOM的輔助函數(shù),以及其他的XML輔助函數(shù)。
dojo.style CSS功能,例如訪問style的大小、與瀏覽器的盒模型配合工作,以及更多的功能。



wangjing 2008-01-28 10:29 發(fā)表評論
]]>
WebWork2.2+DOJO(續(xù))http://www.tkk7.com/vesung/archive/2008/01/16/175525.htmlwangjingwangjingWed, 16 Jan 2008 00:46:00 GMThttp://www.tkk7.com/vesung/archive/2008/01/16/175525.htmlhttp://www.tkk7.com/vesung/comments/175525.htmlhttp://www.tkk7.com/vesung/archive/2008/01/16/175525.html#Feedback0http://www.tkk7.com/vesung/comments/commentRss/175525.htmlhttp://www.tkk7.com/vesung/services/trackbacks/175525.htmlRemote Div Tag

wiki上的文檔翻譯:
Remote DIV 標(biāo)簽和普通的Html的DIV標(biāo)簽工作方式是一樣的,但是它可以通過標(biāo)簽內(nèi)指定的一個網(wǎng)址來裝載它的內(nèi)容.
屬性

名稱 描述
id (必有): DIV的ID
href (必有): 用來獲取內(nèi)容的網(wǎng)址
delay: 第一次裝載內(nèi)容需要延遲多長時間 (毫秒)
updateFreq: 多長時間重新取一次內(nèi)容 (毫秒)
loadingText: 裝載內(nèi)容中對用戶顯示的文字 (特別是取內(nèi)容的時候要花費(fèi)很長的時間
errorText: 如果取內(nèi)容時發(fā)生了錯誤,向用戶顯示的提示
showErrorTransportText: true/false 當(dāng)獲取內(nèi)容有問題的時候,是否把錯誤信息當(dāng)作內(nèi)容顯示
listenTopics: 監(jiān)聽的Topic名稱(多個逗號分割), 將會導(dǎo)致此DIV重新獲取內(nèi)容
afterLoading: 獲取內(nèi)容后要執(zhí)行的Javascript代碼

其他功能
使用javascript代碼我們還可以刷新內(nèi)容,停止或者開始刷新組件.例如一個id是"remotediv1"的div組件:
開始刷新的javascript代碼: remotediv1.start();
停止刷新的javascript代碼remotediv1.stop();
刷新內(nèi)容的javascript代碼:remotediv1.bind();
Remote DIV標(biāo)簽最值得關(guān)注的特性:
可以自己重新裝載自己的內(nèi)容
可以監(jiān)聽Topic,也就是別的動作可以引發(fā)更新內(nèi)容的行為
JavaScript代碼可以控制它的行為
來看Remote Div標(biāo)簽的最簡單的一個例子example1.jsp:
 1 <%@ page contentType="text/html;charset=UTF-8" language="java" %> 
 2 <%@ taglib prefix="ww" uri="/webwork" %> 
 3 <html> 
 4 <head> 
 5 <title>Ajax Examples</title> 
 6 <jsp:include page="../commonInclude.jsp"/> 
 7 </head> 
 8 <body> 
 9 <ww:div id="once" theme="ajax" cssStyle="border: 1px solid yellow;" 
10 href="/AjaxTest.action" delay="5000" loadingText="loading">Initial Content</ww:div> 
11 </body></html> 
12 
這個文件,內(nèi)容非常簡單,使用了一個ww:div標(biāo)簽,設(shè)置了一個id,使用的是ajax這個模板(如果你想定義自己的模板,請務(wù)必參考ajax模板的編寫方法),設(shè)置讀取內(nèi)容的url為"/AjaxTest.action",設(shè)置延遲5000毫秒后讀取內(nèi)容,裝載內(nèi)容時顯示的文本設(shè)置為"loading...",div顯示時的初始內(nèi)容時"Initial Content".

很簡單,在打開網(wǎng)頁5秒后,標(biāo)簽會自動去訪問"/AjaxTest.action",并把獲取的內(nèi)容設(shè)置為Div的內(nèi)容.

再來看一個定時自動刷新的例子:

<ww:div id="twoseconds" cssStyle="border: 1px solid yellow;" href="/AjaxTest.action" 
theme
="ajax" delay="2000" updateFreq="3000" errorText="There was an error">Initial Content</ww:div> 

這個標(biāo)簽產(chǎn)生的結(jié)果每3秒鐘刷新一次DIV的內(nèi)容,和上面的差不多,只是多了一個updateFreq設(shè)置.

此標(biāo)簽還有一個afterLoading屬性,使用方法如下:
<ww:div ...... afterLoading='alert("done")'>Initial Content</ww:div>
<ww:div ...... afterLoading="alert(\"done\")">Initial Content</ww:div>



wangjing 2008-01-16 08:46 發(fā)表評論
]]>
WebWork2.2+DOJOhttp://www.tkk7.com/vesung/archive/2008/01/15/175518.htmlwangjingwangjingTue, 15 Jan 2008 10:03:00 GMThttp://www.tkk7.com/vesung/archive/2008/01/15/175518.htmlhttp://www.tkk7.com/vesung/comments/175518.htmlhttp://www.tkk7.com/vesung/archive/2008/01/15/175518.html#Feedback1http://www.tkk7.com/vesung/comments/commentRss/175518.htmlhttp://www.tkk7.com/vesung/services/trackbacks/175518.html 其中主要增加的特性包括:
1.Remote Div Tag -- 遠(yuǎn)程區(qū)域塊標(biāo)簽,通過異步調(diào)用獲取內(nèi)容,來動態(tài)更新Div.可以循環(huán)更新.
2.Remote A Tag --遠(yuǎn)程鏈接標(biāo)簽,點(diǎn)擊鏈接時進(jìn)行一個遠(yuǎn)程異步調(diào)用,可以動態(tài)更新Div的內(nèi)容.
3.Tabbed Panelds --選項(xiàng)卡頁面,和普通程序中的選項(xiàng)卡一樣,可以有多個選項(xiàng)頁面,每個頁面的內(nèi)容都可以設(shè)置(本地或者從遠(yuǎn)程獲取),點(diǎn)擊一個選項(xiàng)頁,切換頁面.
4.Remote Form --遠(yuǎn)程表單,也就是提交但不刷新的表單,點(diǎn)擊提交按鈕,頁面不刷新,通過遠(yuǎn)程異步調(diào)用,更新目標(biāo)區(qū)域的內(nèi)容.
5.Form Validation --表單校驗(yàn),在表單中的每個控件輸入數(shù)據(jù)都可以進(jìn)行即時的校驗(yàn),主要使用的是DWR.

先了解一下Dojo的工作原理:

清除緩存的代碼:
1 response.setHeader("Pragma""no-cache"); 
2 response.setHeader("Cache-Control""no-cache"); 
3 response.setDateHeader("Expires"0); 
或者用html的meta來試試,不過那就包含在內(nèi)容里了.
為了使用WebWork的AJAX組件,我們需要在頁面里面根據(jù)Dojo的做法包含一些代碼,例如ajax例子里面的commonInclude.jsp文件:
 1 <%@ taglib prefix="ww" uri="/webwork" %> 
 2 <!--// START SNIPPET: common-include--> 
 3 <script language="JavaScript" type="text/javascript"> 
 4 // Dojo configuration 
 5 djConfig = { 
 6 baseRelativePath: "<ww:url includeParams="none" value="/webwork/dojo/"/>"
 7 isDebug: false 
 8 }; 
 9 </script> 
10 
11 <script language="JavaScript" type="text/javascript" 
12 src="<ww:url includeParams="none" value="/webwork/dojo/dojo.js" />"></script> 
13 <script language="JavaScript" type="text/javascript" 
14 src="<ww:url includeParams="none" value="/webwork/CommonFunctions.js" />"></script> 
15 
16 <script language="JavaScript" type="text/javascript"
17 dojo.require("dojo.io.BrowserIO"); 
18 dojo.require("dojo.event.topic"); 
19 dojo.require("webwork.widgets.Bind"); 
20 dojo.require("webwork.widgets.BindDiv"); 
21 dojo.require("webwork.widgets.BindButton"); 
22 dojo.require("webwork.widgets.BindAnchor"); 
23 </script> 
24 <!--// END SNIPPET: common-include--> 
25 
這個文件里面對Dojo進(jìn)行了設(shè)置,包含dojo.js,并且引入了webwork實(shí)現(xiàn)的這幾個裝飾件的代碼,在后面的每個例子中,都要包含這個文件,因?yàn)楹竺娴慕榻B中將省略這個文件的介紹,要想了解更多信息,可以參考Dojo的文檔.

提示:其實(shí)在webwork框架下面引入dojo最容易了只需在頁面加入下面一行即可:
<ww:head theme="ajax" debug="true" />

--待續(xù)--

wangjing 2008-01-15 18:03 發(fā)表評論
]]>
主站蜘蛛池模板: 免费一级黄色毛片| 999国内精品永久免费观看| 国产精品久免费的黄网站| 国产99在线|亚洲| 在线视频精品免费| 亚洲一级高清在线中文字幕| 8090在线观看免费观看| 亚洲欧洲日产国产综合网| 久久久久久久99精品免费| 亚洲国产精华液网站w| 免费观看在线禁片| 亚洲一级免费视频| 69堂人成无码免费视频果冻传媒 | 亚洲国产综合专区在线电影 | 国产成人精品免费视频网页大全| 免费人成视频x8x8入口| 国产亚洲日韩在线a不卡| 亚欧免费无码aⅴ在线观看| 91亚洲国产成人精品下载| 69堂人成无码免费视频果冻传媒| 亚洲精品无码久久久久久| 国产三级电影免费观看| 亚洲三级视频在线| 日本免费一本天堂在线| 日韩毛片免费一二三| 久久久久久久综合日本亚洲| 免费观看激色视频网站bd| 亚洲av无一区二区三区| 一本无码人妻在中文字幕免费| 亚洲另类无码一区二区三区| 亚洲精品成人久久久| 久久久高清日本道免费观看| 亚洲国产成人久久三区| 亚洲福利精品一区二区三区| 精品国产一区二区三区免费| 波多野结衣亚洲一级| 亚洲片国产一区一级在线观看| 久久中文字幕免费视频| 亚洲AV无码之国产精品| 亚洲激情在线观看| 免费国产a国产片高清|