Intervalid: ",
COUNT:120,
Sendsmscode:function () {
var _thi = this;
if (_thi.smscodesending) {
Return
}else if (!$ ("#mobilePhone"). Validator (). Validator (' check ')) {
Return
}
_thi.smscodesending = true;
var data = new Object ();
Data.mobile = $ (' #mobilePhone '). Val ();
Data.name = $ (' #name '). Val ();
Data.productcode = $ (' #productCode '). Val ();
$.ajax ({
Url:window.gsysname+ "/do/largess/smsvcode/send",
Type: ' GET ',
Data:data,
DataType: ' JSON ',
Success:function (msg) {
if (msg.resultcode== ' 0 ') {
$ (' #countSpan '). Text (' (120 seconds) ');
_thi.count = 119;
$ (' #randTxt '). Text (' Get Dynamic Code again ');
_thi.intervalid = Window.setinterval (function () {
if (_thi.count>0) {
$ (' #countSpan '). Text (' (' +_thi.count+ ') ');
_thi.count--;
}else{
Window.clearinterval (_thi.intervalid);
_thi.smscodesending = false;
$ (' #countSpan '). Text (')
$ (' #randTxt '). Text (' Get dynamic Code ');
}
},1000);
$ (' #randTip '). FadeIn ();
Window.settimeout (function () {
$ (' #randTip '). FadeOut ();
},6000);
}
},error:function () {
_thi.smscodesending = false;
}
});
},
Ajax SMS Verification Code interface, Setinterval,clearinterval countdown display