| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152 |
- function sendmsgbutton(){
- if ($("#mobile").val()=="") {
- alert("请输入手机号码");
- $("#mobile").focus();
- return;
- }
- var aj = $.ajax( {
- url:'index.php?',
- data:{ phonenum : $("#mobile").val() , mod:"sendsms" },
- type:'post',
- cache:false,
- dataType:'json',
- success:function(data) {
- if($.trim(data) =="success" ){
-
- }else{
- }
- },
- error : function() {
- }
- });
- var test = {
- node:null,
- count:120,
- start:function(){
- if(this.count > 0){
- this.count--;
- this.node.value = this.count + "秒后可重新获取";
- var _this = this;
- setTimeout(function(){
- _this.start();
- },1000);
- }else{
- this.node.removeAttribute("disabled");
- this.node.setAttribute("class","disabled");
- this.node.value=("再次发送");
- this.count = 120;
- }
- },
- init:function(node){
- this.node = node;
- this.node.setAttribute("disabled",true);
- this.node.setAttribute("class","disable");
- this.start();
- }
- };
- var btn = document.getElementById("sendmsg");
- test.init(btn);
- }
|