This article is mainly on the JS 60 seconds and Countdown to the sample code is introduced, the need for friends can come to the reference, I hope to help you.
Use JS to judge 60 seconds to the time, first define a variable refreshtime, when the event is triggered to check the success of the last request is now more than 60 seconds, if not more than 60 seconds, pop-up prompts, otherwise allow the request to continue, after the successful request, The current time assignment to refreshtime, the implementation of the way; code is as follows: UsingNamespace ("Biz.accountcenter") ["Cellphonevalidation"]={ refreshtime:0,//variable checkrefreshget:function (timelimit)/check time, TimeLimit the interval of time (in seconds) required for incoming requests, such as: { var nowtime = new Date (); var n Owminitepoint=nowtime.gethours () *3600+nowtime.getminutes () *60+nowtime.getseconds (); &NBSP;IF (Nowminitepoint-biz.accountcenter.cellphonevalidation.refreshtime<timelimit) { return false   &N Bsp;return true; }, resetrefreshget:function ()//request succeeded, the method called to reset the defined variable to the current time { &NBSP ; var nowtime = new Date (); var Nowminitepoint=nowtime.gethouRS () *3600+nowtime.getminutes () *60+nowtime.getseconds (); Biz.AccountCenter.CellPhoneValidation.refreshTime=nowMinitePoint; }, & nbsp dynamicmessage:function (Timesecond)//Countdown method Timesecond to start from how many seconds, such as: { var Showtimmer; if (Showtimmer) { cleartimeout (Showtimmer); &NB Sp &NBSP if (timesecond==dynamicvalidate.refreshtimelimit) & nbsp { var Messagerefresh =$.newegg.format (Dynamicvalidate.refreshspanmessage, Timesecond); $ ("#spanRefresh"). HTML ("<span>" +messagerefresh+ "</span>"); $ ("#spanRefresh"). attr ("Class", "button btn_yanz_disable"); timeSecond--; &NBSP} &NBSP; showtimmer = settimeout (function () { var Messagerefresh =$.N Ewegg.format (Dynamicvalidate.refreshspanmessage,timesecond); $ ("#spanRefresh"). HTML ("<span>" +messagerefresh+ "</span>"); timeSecond--; if (Timesecond < 0) { &NBSP;C Leartimeout (Showtimmer); $ ("#spanRefresh") attr ("Class", "button Btn_yanz"); $ ("#spanRefresh"). HTML ("<span>" + Dynamicvalidate.refreshmessage+ "</span>"); &NBSP} else { biz.accountcenter . Cellphonevalidation.dynamicmessage (Timesecond); $ ("#spanRefresh"). attr ("clAss "," button btn_yanz_disable "); &NBSP, }, 1000; }, create:function (Obj,page,iscancelphone)//Per request Call method { &NBSP;&N Bsp if (! Biz.AccountCenter.CellPhoneValidation.checkRefreshGet (Dynamicvalidate.refreshtimelimit))//per request, JS check 60s time interval { $ ("#valiateerror"). Empty (). HTML ("<span class= ' V Alidform_wrong ' > ' +$.newegg.format ($Resource. Buildcontent ("Accountcenter_modifydyanmic_ Cannotrepeatclick"), Dynamicvalidate.refreshtimelimit) + "</span>"). Show (); $ ("#mobilewarning"). Hide (); return; } $.get ("url", Data,function () { & nbsp //If successful &NBSP;BIZ.ACcountCenter.CellPhoneValidation.dynamicMessage (dynamicvalidate.refreshtimelimit)/countdown biz.accountcenter.cellphonevalidation.resetrefreshget ()/Reset time }); }