版權說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權,請進行舉報或認領
文檔簡介
Project1MemberManagementSystemSchoolofSoftware,ChengduPolytechnicLecturer:MuQichunTask20ApplicationofbeforeSendTheProposedQuestionTheadoptionofAjaxasynchronouswaybearsobviousadvantages.Underthesituationofnotrefreshingthepage,thepagecouldbeupdateddirectlyandtheuserenjoysbetterexperience.However,sinceit’snotsynchronousoperation,theupdateisdelayedfortheslowspeedofnetwork,suchexperiencewouldbedeclined.Tosolvethisproblem,wecouldusebeforeSendtocallback.Whenissuingtherequest,displaytheiconLoading,giveaclearhinttotheuser,soastocreateabetterexperience.Comparedwiththoseinthepast,computersandnetworkhardwareconstructionhavebeenmuchbetter.However,inrecentyears,USAiscontinuouslydepressingChinainthebusinessofchip.FromthepunishmentonZTEandthebanningonHuawei,thepainofchiplackhasfallenontheheartofeveryChinesepeople.WhenChinaislackofchips,USAcomestoblockwithchipbans.WhenChinahasovercomethelackofchips,USAcomestostopwithmanufactureofchips.WhenChinahasfiguredoutawayinchipmanufacturing,USAwillcometoblockthewaywithmanufacturingofequipment,materialsandsoftware.Therefore,gettingoutofthetroubleofchiplack,Chinaisdemandingoncourageandrationality.SinceUSAisdepressingChinawithchips,thisisachanceforChinesepeopletopaddleitsowncanoe.EveryChinesemanshouldstrivehardfortheriseofChinesenation.ApplicationofBeforeSendWhenlosingthefocusoftheinputframeofusername,executetheAjaxprogram,tomaketherequestonthebackend.Aftertheback-endprogramhasbeenexecutedandtheresulthasbeensent,thefront-endpagewillexecutethecorrespondingupdating.WhenusingAjaxofjQuery,wecouldhandleinthethreecallbacks:complete,success,anderror.Thatis,aftertheexecutionofback-endprogramisfinishedandtheresultissentbacktothefrontend,thecallbackofcompletewilldefinitelybeexecuted.Iftheexecutionissuccessful,thecallbackofsuccesswillbeexecuted.Ifnot,thecallbackoferrorwillbeexecuted.Beforetherequestismade,call-backofbeforeSendwillbeexecuted.Therefore,wecoulddisplaytheiconLoadinginbeforeSend,andhideitincomplete,success,anderror.RelevantCodeFirst,downloadadynamiciconloading.gifontheinternetandputitintotheproject.Thenmodifythecodeintheusernameinputframe:Addapictureaftertheusername,i.e.thedownloadedloading.gif,andadditsIDasloading.It’sobviousthat,normallythisanimatedicondoesnotshowup.Therefore,weaddincssthat:1.#loading{2.display:none3.}Setthesizeoftheanimatediconas80pxandconductthehidingdisplay.WhenusingAjaxforcommunication,thisanimatediconwillbedisplayedduringthecallbackofbeforeSendandhiddenagainincomplete.RelevantCodeThecommunicationcodeoftherevisedajaxisasfollows:RelevantCodeInLine6,weusethecallbackofbeforeSend,todeletethepromptmessageanddisplaytheanimatedicon.InLine11andLine26,thecodetohidetheanimatediconisadded.Withcomplete,theone-timeaddingof$("#loading").hide();isenough.Duetothesimplecontent,thisback-endrequestnormallytakeslittletimeandtheanimationeffectisnotveryobvious.Totestthiseffect,intheback-endfile,addanlatencyprogrambeforejson_encode,suchassleep(3);tomeanthepausingof3seconds.Therefore,therotationforawhileoftheanimatediconisseeninthefrontend,meaningtheback-endrequestisundergoing.Whentherequestissuccessful(orfails),theanimated
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預覽,若沒有圖紙預覽就沒有圖紙。
- 4. 未經(jīng)權益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負責。
- 6. 下載文件中如有侵權或不適當內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 2025云南昭通潤澤高級中學招聘2人備考題庫完美版
- 2026河南焦作市圖書館寒假志愿者招募備考題庫及一套完整答案詳解
- 2026海南三亞市市場監(jiān)督管理局上半年招聘下屬事業(yè)單位工作人員1人備考題庫(第1號)及一套參考答案詳解
- 奇妙的動物世界:我是小小解說員-小學語文二年級上冊口語交際深度學習方案設計
- 2026湖南長沙市星城實驗小學春季校聘教師招聘備考題庫及答案詳解(考點梳理)
- 2026貴州黔東南州黃平縣中醫(yī)醫(yī)院招聘編外人員6人備考題庫(第一輪)及答案詳解(考點梳理)
- 我國商業(yè)銀行信貸資產(chǎn)證券化風險剖析-以“中盈2017 - 2”為鑒
- 區(qū)域規(guī)劃實施安全風險預案
- 2026青海西寧城西區(qū)西部礦業(yè)集團有限公司黨務工作部門業(yè)務崗位選聘5人備考題庫附答案詳解
- 2026福建福州市馬尾海關單證資料管理崗位輔助人員招聘1人備考題庫及答案詳解(考點梳理)
- 中國重癥超聲臨床應用專家共識
- 潔凈區(qū)環(huán)境監(jiān)測培訓課件
- 北魏《元楨墓志》完整版(硬筆臨)
- 鋁材銷售技巧培訓
- 肺奴卡菌病課件
- 2024-2025學年上學期深圳高一物理期末模擬卷1
- 胸痛中心聯(lián)合例會培訓
- 天然氣長輸管道工程培訓課件
- 江門市2025屆普通高中高三10月調(diào)研測試 英語試卷(含答案)
- 天鵝到家合同模板
- 人力資源行業(yè)招聘管理系統(tǒng)設計方案
評論
0/150
提交評論