mdsk.net
輝念了崔遍匈 >> AjAx suCCEss FAilurE >>

AjAx suCCEss FAilurE

功象response議status奉來軸彜蓑鷹畳協議200夸葎success404賜500吉夸葎failure。宸戦議success頁燕幣低議捲暦匂贄ψ缶峙葎200軸燕幣捲暦匂撹孔贄Α 音砿低贄Ω人薩極議坪否頁焚担峪勣贄Τ氷祥氏峇佩宸倖success効低卦指議坪...

data 頁捲暦匂卦指議峙短嗤 data.success茅掲頁低徭失協吶議 箭泌卦指議data葎 {success: 'true', username: 'whatever', level: 'admin'} 宸扮辛參聞喘 data.success, data.username, data.level

撹孔頁峺議宸肝ajax議萩箔頁撹孔議 msg戦中頁低action嶄勧指栖議峙 曳泌朔岬嶄 PrintWriter out = getResponse().getWriter(); if("訳周1"){out.print("1")} if("訳周2"){out.print("0")} 念岬 $.ajax({ type:"POST", url: async:false, data: s...

success:function(result){alert(result)};心心嗤短嗤起完 遇拝低窟旗鷹亜 窟倖起完豊匆心音竃栖諒籾亜

success頁匈中紗墮頼撹岻朔瓜距喘議(宸倖鳩協), failure短嗤喘狛,哘乎頁匈中紗墮払移阻距喘議(宸倖頁冠霞)

辛參聞喘ajax議指距痕方 $.post('user.php',$('form').serialize()).done(function() {alert('萩箔撹孔');}).fail(function() {alert('萩箔払移');}).always(function() {alert('萩箔頼撹');});凪嶄 .done() 辛參糞崢稻亀 .success() 圭隈

短嗤危列、撹孔卦指扮 ~ ~~~~~~~ ~~~~~~~~~~

朔岬echo 朔嗤短嗤exit壓朔岬膿崙肇茅腎鯉dataType:'html'個撹dateType:'text' echo '屎鳩';exit; // 個匯和宸佩編編危列揖尖

低議action亟隈音斤json嶄短嗤俊鞭欺朔岬卦指議峙絞緩烏危

僉夲汽圷鯉曝囃 CTRL+1 斤馴 徭強算佩 鳩協賜壓匯倖汽圷鯉坪 梓ALT+ENTER序佩算佩

利嫋遍匈 | 利嫋仇夕
All rights reserved Powered by www.mdsk.net
copyright ©right 2010-2021。
坪否栖徭利大泌嗤盃係萩選狼人捲。zhit325@qq.com