ProcessData yog dab tsi hauv Ajax?
ProcessData yog dab tsi hauv Ajax?

Video: ProcessData yog dab tsi hauv Ajax?

Video: ProcessData yog dab tsi hauv Ajax?
Video: Ua Dab Tsi Txhaum Koj - David Yang (New Song 2021) 2024, Hlis ntuj nqeg
Anonim

processData . Yog tias teem rau cuav nws nres jQuery ua ib qho ntawm cov ntaub ntawv. Hauv lwm lo lus yog processData yog tsis tseeb jQuery tsuas yog xa txhua yam koj teev raws li cov ntaub ntawv hauv ib qho Ajax thov yam tsis muaj kev sim hloov nws los ntawm kev encoding raws li cov lus nug.

Kuj paub yog, dataType hauv Ajax yog dab tsi?

Hom ntaub ntawv puas yog koj qhia jQuery seb yuav teb li cas. Cia siab tias JSON, lossis XML, lossis HTML, thiab lwm yam. Lub neej ntawd yog rau jQuery sim thiab txheeb xyuas nws.

Ib yam li ntawd, Ajax txhais li cas? AJAX = Asynchronous JavaScript thiab XML. AJAX yog ib txoj hauv kev los tsim cov nplooj ntawv nrawm thiab nrawm. AJAX tso cai rau cov nplooj ntawv web kom hloov kho asynchronously los ntawm kev sib pauv cov ntaub ntawv me me nrog cov neeg rau zaub mov tom qab. Qhov no txhais tau tias tias nws muaj peev xwm hloov kho qhov chaw ntawm nplooj ntawv web, tsis tas yuav rov qab tag nrho nplooj ntawv.

Kuj paub, Ajax hu ua haujlwm li cas?

  1. Tus neeg siv xa daim ntawv thov los ntawm UI thiab javascript hu mus rau XMLHttpRequest object.
  2. HTTP Thov xa mus rau lub server los ntawm XMLHttpRequest object.
  3. Server cuam tshuam nrog database siv JSP, PHP, Servlet, ASP.net thiab lwm yam.
  4. Cov ntaub ntawv rov qab tau.
  5. Server xa XML cov ntaub ntawv lossis JSON cov ntaub ntawv mus rau XMLHttpRequest callback function.

Dab tsi yog async cuav hauv Ajax?

Yog lawm. Kev teeb tsa async rau cuav txhais tau hais tias cov nqe lus koj tab tom hu yuav tsum ua kom tiav ua ntej nqe lus tom ntej hauv koj txoj haujlwm tuaj yeem hu. Yog koj teem async : tseeb ces nqe lus ntawd yuav pib nws ' s execution thiab cov nqe lus tom ntej yuav raug hu tsis hais seb tus async nqe lus tau ua tiav tsis tau.

Pom zoo: