? ??? ???? jQuery ???? ?? ??? ?????. ??? ? ??? ?? ??? ?????. ??? ??? ??? ????.
<script language="javascript" type="text/javascript"> function doSomething(callback) { // … // Call the callback callback('stuff', 'goes', 'here'); // 給callback賦值,callback是個(gè)函數(shù)變量 } function foo1(a, b, c) { // I'm the callback alert(a + " " + b + " " + c); } doSomething(foo1); // foo1函數(shù)將使用callback函數(shù)中的數(shù)據(jù) stuff goes here var foo2 = function(a,b,c) { // I'm the callback alert(a + " " + b + " " + c); } doSomething(foo2); // foo2函數(shù)將使用callback函數(shù)中的數(shù)據(jù) stuff goes here doSomething(function(a,b,c){ alert(a + " " + b + " " + c); // function函數(shù)將使用callback函數(shù)中的數(shù)據(jù) stuff goes here }); </script>
?? ????? ????? ???? ???. ?? ??? ?? ??????.
<script language="javascript" type="text/javascript"> function doSomething(callback) { // … // Call the callback if(typeof callback === 'function'){ callback('stuff', 'goes', 'here'); // 給callback賦值,callback是個(gè)函數(shù)變量 }else{ alert('jb51.net'); } } function foo1(a, b, c) { // I'm the callback alert(a + " " + b + " " + c); } doSomething(foo1); // foo1函數(shù)將使用callback函數(shù)中的數(shù)據(jù) stuff goes here var foo2 = function(a,b,c) { // I'm the callback alert(a + " " + b + " " + c); } doSomething(foo2); // foo2函數(shù)將使用callback函數(shù)中的數(shù)據(jù) stuff goes here doSomething(function(a,b,c){ alert(a + " " + b + " " + c); // function函數(shù)將使用callback函數(shù)中的數(shù)據(jù) stuff goes here }); var foo3 = 'a'; doSomething(foo3); </script>
foo3? ??? ??? jb51.net? ???
jQuery ????
?? ??
$.fn.citySelect=function(settings)
?? ??
$.fn.citySelect=function(settings, changeHandle) // 添加回調(diào)函數(shù)changeHandle
?? ??? ? ??
//選項(xiàng)變動(dòng)賦值事件 var selectChange = function (areaType) { if(typeof changeHandle === 'function'){ // 判斷callback是否是函數(shù) var prov_id = prov_obj.get(0).selectedIndex; var city_id = city_obj.get(0).selectedIndex; var dist_id = dist_obj.get(0).selectedIndex; if(!settings.required){ prov_id--; city_id--; dist_id--; }; if(dist_id<0){ var data = { prov: city_json.citylist[prov_id].p, city: city_json.citylist[prov_id].c[city_id].n, dist: null }; }else{ var data = { prov: city_json.citylist[prov_id].p, city: city_json.citylist[prov_id].c[city_id].n, dist: city_json.citylist[prov_id].c[city_id].a[dist_id].s }; } changeHandle(data, areaType); // 返回兩個(gè)處理好的數(shù)據(jù) } };
?, ?, ? ??? ???? ???? ?? ??? ??? ?????. ? ???
// 選擇省份時(shí)發(fā)生事件 prov_obj.bind("change",function(){ cityStart(); selectChange('prov'); // 返回?cái)?shù)據(jù) }); // 選擇市級時(shí)發(fā)生事件 city_obj.bind("change",function(){ distStart(); selectChange('city'); // 返回?cái)?shù)據(jù) }); // 選擇區(qū)級時(shí)發(fā)生事件 dist_obj.bind("change",function(){ selectChange('dist'); // 返回?cái)?shù)據(jù) });??? ??
? ???? selectAgent ??
$("#s_city").citySelect({ prov: "江蘇省", city: "宿遷市", dist: "宿城區(qū)", nodata: "none" }, function(data, type) { selectAgent(data.city, data.dist); });? ?? ???? ??? ???? ?????.
ajax ???? ?? ?? ????? ?????.
???? ??? ???????.
function selectAgent(city,district){ $.ajax({ type:"POST", url:"{sh::U('Index/ajax',array('todo'=>'getagent'))}", data:"city="+city+"&district="+district, success:function(json){ json = JSON.parse(json); opt_str = "<option value=''>-請選擇-</option>" if(json.status == 1){ $.each(json.data,function(index,con){ opt_str += "<option value="+con.id+">"+con.name+" 電話:"+con.tel+"</option>" }) } $('#agent_id').html(opt_str); } }); }

? AI ??

Undress AI Tool
??? ???? ??

Undresser.AI Undress
???? ?? ??? ??? ?? AI ?? ?

AI Clothes Remover
???? ?? ???? ??? AI ?????.

Clothoff.io
AI ? ???

Video Face Swap
??? ??? AI ?? ?? ??? ???? ?? ???? ??? ?? ????!

?? ??

??? ??

???++7.3.1
???? ?? ?? ?? ???

SublimeText3 ??? ??
??? ??, ???? ?? ????.

???? 13.0.1 ???
??? PHP ?? ?? ??

???? CS6
??? ? ?? ??

SublimeText3 Mac ??
? ??? ?? ?? ?????(SublimeText3)

jQuery ?? ??? ?? ??? ??: ?? ?? ??? jQuery? ? ??? ??? ?? ???? JavaScript ??????, JavaScript ?????? ????? ????? ??? ??? ?????. ? ????? jQuery? ?? ??? ??? ???? ??? ??? ??? ? ??? ???? ?? ??? ?????. jQuery ?? ?? HTML ??? jQuery ?????? ???? ???. CDN ??? ?? ????? ????? ? ????.

jQuery?? PUT ?? ??? ???? ??? ?????? jQuery?? PUT ??? ??? ??? ?? ??? ??? ??? ?? ????? ? ?? ?? ??? ?? ?? ??? ???? ???. PUT ??? ????? ??????? ??? ???? ?? ??? ?? ????? ?? ???? ?????? ? ?????. ??? jQuery?? PUT ?? ???? ???? ???? ?? ?????. ?? jQuery ????? ??? ????? ??? ?? $.ajax({u? ?? PUT ??? ?? ? ????.

??: jQuery ?: ???? ?? ?? ??? ???? ??? ?????. ? ????? ???? ??? ???? ???? ?? ??? ????. jQuery? ??? ? ???? ?? ?? ??? ??? ??? ? ?? ???? ?? ??? ???, ?? ??? ???? ??? ? ????. ??? jQuery? ???? ???? ?? ?? ???? ??? ???? ??? ???? ???? ?? ??? ?????. ?? jQuery ????? ??? ???? ?? ??? ???? ?????? ???? ???. <

??: jQuery? ???? ?? ??? ??? ??? ?????. jQuery? DOM ??? ???? ? ?? ???? ?? ?? JavaScript ????????. ? ??? ?? ?? ???? ?? ?? ??(??)? ??? ??? ???? ?? ??? ?? ????. ? ????? jQuery? ???? ? ??? ???? ??? ???? ???? ?? ??? ?????. ?? ???? jQuery ?????? ???? ???. HTML ??? ?? ??? ?????.

jQuery? ???? ??? ?? ??? ???? ??? ?????? ????? ????? ??? ?? ??? ???? ?? ??? ?? ????. ??? ??? ??? ???? ???? ? ?? ?? ??? ?? ??? ???? ?? ??? ????. ? ????? jQuery? ???? ??? ?? ??? ???? ??? ???? ???? ?? ??? ?????. jQuery? ???? ?? ??? ???? ?? ?? CSS? ?? ??? ???? ???. height ??? ??? ??? ???? ? ?????.

jQuery? ? ????? DOM ?? ? ??? ??? ???? ? ?? ???? ?? ?? JavaScript ????????. jQuery?? eq() ???? ??? ??? ???? ??? ???? ? ?????. ???? ?? ? ?? ????? ??? ????. jQuery?? eq() ???? ??? ??? ??? ?? ??? ?????. ??? ??? 0?? ???? ?????. ?, ? ?? ??? ???? 0?? ? ?? ??? ???? 1???. eq() ???? ??? ??? ????: $("s

jQuery? ? ??? ?? ???? ?? ?? JavaScript ????????. ? ?? ?? JavaScript? ?? ???? ? ?? ???? ???? ?? ??? ????. ? ????? jQuery? ???? ???? ? ?? ???? ??? ???? ?? ?? ??? ?????. ?? HTML ???? jQuery ?????? ???? ???. jQuery ?????? ?? ??? ?? ??? ??? ? ????.

jQuery ??? ?? ??? ??? ??? ? ? ???? jQuery? ???? DOM ??? ??? ? ??? ?? ??? ??? ???? ?? ??? ?? ?????. ? ?? jQuery?? ???? ???? ???? ? ??? ?? ??? ? ????. ??? jQuery ??? ?? ??? ??? ???? ?? ????? ???? ? ?? ??? ?? ?? ??? ?? ?????. ?? 1: attr() ???? typeof ???? // ???? ??? ?? ??? ??? ??
