锘??xml version="1.0" encoding="utf-8" standalone="yes"?>久久日韩精品一区二区五区,风间由美一区,国产欧美一区二区三区精品观看http://www.aygfsteel.com/vso/category/16109.htmlJAVA EEzh-cnSat, 03 Mar 2007 09:13:06 GMTSat, 03 Mar 2007 09:13:06 GMT60Introduction to dojo.io.bindhttp://www.aygfsteel.com/vso/articles/79310.htmlvsovsoMon, 06 Nov 2006 01:02:00 GMThttp://www.aygfsteel.com/vso/articles/79310.htmlhttp://www.aygfsteel.com/vso/comments/79310.htmlhttp://www.aygfsteel.com/vso/articles/79310.html#Feedback0http://www.aygfsteel.com/vso/comments/commentRss/79310.htmlhttp://www.aygfsteel.com/vso/services/trackbacks/79310.html聽 聽dojo.io鐨勮澶氫笉鍙濊鐨勫姛鑳介兘鐢眀ind()鏂規硶鏉ュ疄鐜般傦紙鍙兘鑴氭湰璇█鎴栦笉瀹氬弬鏁扮殑璇█閮藉枩嬈㈣繖鏍鳳紝璇村疄璇濓紝鎴戜笉鍠滄錛夈俤ojo.io.bind()鏄竴涓櫘閫氱殑鍖垮悕璇鋒眰API錛屽畠鐨勫簳灞傚彲浠ユ槸涓嶅悓鐨勪紶杈撴満鍒?queues of iframes, XMLHTTP, mod_pubsub, LivePage, 絳?銆俤ojo浼氬皾璇曢夋嫨鏈濂界殑浼犺緭鏈哄埗錛屽鏋滀綘鐨勭幆澧冩敮鎸佸縐嶄紶杈撴満鍒訛紝XMLHTTP浼氭槸dojo鐨勯閫夈俠ind()鏂規硶鐨勫弬鏁版槸涓涓畝鍗曠殑鍖垮悕瀵硅薄錛屽綋鐒惰繖涓璞$殑灞炴ф槸寮傚父鐏墊椿鐨勩?br />聽濡傛灉浣犺寰楀埌涓涓猼ext鏂囦歡錛屽彲鑳戒唬鐮佸涓嬶細

dojo.io.bind({
聽 聽url: "http://foo.bar.com/sampleD...,
聽 聽load: function(type, data, evt){ /*do something w/ the data */ },
聽 聽mimetype: "text/plain"
});

鍜宲rototype.js/YUI絳夊樊涓嶅錛岀畝鍗曠殑浠g爜鍙互寰楀埌鏁版嵁銆傚彲鑳戒綘涔熸兂鍒幫紝濡傛灉鍑虹幇閿欒鎬庝箞 鍔烇紝綆鍗曟敞鍐屼竴涓敊璇鐞嗗嚱鏁板氨濂戒簡錛?br />

dojo.io.bind({
聽 聽url: "http://foo.bar.com/sampleD...,
聽 聽load: function(type, data, evt){ /*do something w/ the data */ },
聽 聽error: function(type, error){ /*do something w/ the error*/ },
聽 聽mimetype: "text/plain"
});


dojo涔熷彲浠ユ妸鎵鏈夌殑澶勭悊鏀懼埌涓涓嚱鏁伴噷錛屽涓?

dojo.io.bind({
聽 聽url: "http://foo.bar.com/sampleD...,
聽 聽handle: function(type, data, evt){
聽 聽 聽 聽if(type == "load"){
聽 聽 聽 聽 聽 聽// do something with the data object
聽 聽 聽 聽}else if(type == "error"){
聽 聽 聽 聽 聽 聽// here, "data" is our error object
聽 聽 聽 聽 聽 聽// respond to the error here
聽 聽 聽 聽}else{
聽 聽 聽 聽 聽 聽// other types of events might get passed, handle them here
聽 聽 聽 聽}
聽 聽},
聽 聽mimetype: "text/plain"
});

鑰冭檻鎬ц兘鍘熷洜錛孉jax緇忓父閲嶆湇鍔″櫒榪斿洖涓孌靛彲鎵ц鐨刯avascript浠g爜孌碉紝鍦ㄦ祻瑙堝櫒涓璭val(瀹?銆備綘鍙鎸囧畾mimetype: "text/javascript" 灝?br />
鍙互浜嗭紝dojo浼氳嚜鍔ㄤ負浣?eval榪欎簺javascript浠g爜錛?br />

dojo.io.bind({
聽 聽url: "http://foo.bar.com/sampleD...,
聽 聽load: function(type, evaldObj){ /* do something */ },
聽 聽mimetype: "text/javascript"
});

浣犱篃鍙互鎸囧畾浣犱嬌鐢ㄥ摢縐嶄紶杈撳櫒 濡?XMLHTTPTransport:

dojo.io.bind({
聽 聽url: "http://foo.bar.com/sampleD...,
聽 聽load: function(type, evaldObj){ /* do something */ },
聽 聽mimetype: "text/plain", // get plain text, don't eval()
聽 聽transport: "XMLHTTPTransport"
});


Being a jack-of-all-trades, bind() also supports the submission of forms via a request (with the single caveat that it won't do file upload over XMLHTTP):
????寰楃湅鐪嬩唬鐮侊紵鏄惁url浼氳鐩朼ction.


dojo.io.bind({
聽 聽url: "http://foo.bar.com/process...,
聽 聽load: function(type, evaldObj){ /* do something */ },
聽 聽formNode: document.getElementById("formToSubmit")
});

鍛靛懙錛屼笉閿欏惂銆備笅闈㈢湅鐪嬪嚑涓紶杈撳櫒銆?br />
Transports:
dojo.io.bind鍜屽叾瀹冪浉鍏沖嚱鏁頒笌鏈嶅姟鍣ㄩ氫俊鏈夊嚑縐嶆柟娉曪紝鍙玊ransport錛屾瘡縐峊ransports鍙兘閮芥湁緙洪櫡錛屽洜姝ゅ湪鐗瑰畾鍦哄悎浣犲繀欏婚夋嫨鍚堥傜殑transport銆?br />榛樿鐨則ransport鏄ぇ瀹剁啛鎮夌殑 XMLHttp.

XMLHttp

xmlhttp鍦ㄥぇ閮ㄥ垎鎯呭喌涓嬪伐浣滅殑寰堝ソ錛屼絾瀹冧笉鑳戒笂浼犳枃浠訛紝涓嶈兘璺ㄥ煙宸ヤ綔錛屼篃涓嶈兘鍦╢ile://鍗忚涓嬪伐浣溿傦紙dojo涔熶唬鏇跨殑鏂規錛?br />
渚嬪瓙浠g爜:

<script type="text/javascript"> 聽 dojo.require("dojo.io.*"); 聽
function mySubmit({ 聽 聽
聽 聽dojo.io.bind ({ 聽 聽 聽
聽 聽url: 'server.cfm', 聽 聽 聽
聽 聽handler: callBack, 聽 聽 聽 聽 聽
聽 聽formNode: dojo.byId('myForm') 聽 聽
聽}); 聽
} 聽
function callBack(type, data, evt) { 聽
聽 聽dojo.byId('result').innerHTML = data; 聽
}
</script>


IFrame I/O錛?/strong>
IFrame I/O transport鏄湁鐢ㄧ殑錛屽畠鍙互涓婁紶鏂囦歡. 聽渚嬪瓙浠g爜:


<script type="text/javascript"> 聽 dojo.require("dojo.io.*"); 聽
dojo.require("dojo.io.IframeIO");
function mySubmit() { 聽 聽
聽dojo.io.bind ({ 聽 聽 聽 聽 聽 url: 'server.cfm', 聽 聽 聽
聽 聽handler: callBack, 聽 聽 聽
聽 聽formNode: dojo.byId('myForm') 聽 聽 聽 }); 聽
} 聽
function callBack(type, data, evt) { 聽 聽 聽
聽dojo.byId('result').innerHTML = data; 聽
}
</script>

The response type from the above URL can be text, html, or JS/JSON.
榪欑鍝嶅簲綾誨瀷鐨剈rl鍙互鏄痶ext,html鎴栬卝s/json.

vso 2006-11-06 09:02 鍙戣〃璇勮
]]>
主站蜘蛛池模板: 清远市| 浦城县| 清丰县| 南溪县| 平原县| 甘孜| 巴彦县| 辽宁省| 敦化市| 肇东市| 定兴县| 通州区| 麻城市| 包头市| 崇文区| 武宣县| 天长市| 天全县| 桦甸市| 荣昌县| 怀宁县| 夏邑县| 景东| 通河县| 枝江市| 大方县| 平谷区| 万荣县| 郎溪县| 金坛市| 禹州市| 潜山县| 高密市| 清流县| 绥化市| 峨边| 玉溪市| 竹山县| 原平市| 平凉市| 广水市|