关于按钮触发js特效后台无法执行 document.getElementById("yan").onclick=function(){time(this);} 这句让你不会去执行后台方法可以这样写OnClientClick="time()" OnClick="yan_onClick" 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 服务器端的空间ID在生成HTML标签时ID可能不是“yan”,你查看下源代码 <script type="text/javascript"> var wait=45; document.getElementById("yan").disabled = false; function time(o) { if (wait == 0) { o.removeAttribute("disabled"); o.value="获取验证码"; wait = 5; } else { o.setAttribute("disabled", true); o.value="重新发送(" + wait + ")"; wait--; setTimeout(function() { time(o) }, 1000) } } onclick=function(){time(this);} </script> js这样写么?这样好像是执行了后台的方法。不过没倒计时的效果了? <script type="text/javascript"> var wait=45; document.getElementById("yan").disabled = false; function time(o) { if (wait == 0) { o.removeAttribute("disabled"); o.value="获取验证码"; wait = 5; } else { o.setAttribute("disabled", true); o.value="重新发送(" + wait + ")"; wait--; setTimeout(function() { time(o) }, 1000) } } onclick=function(){time(this);} </script> js这样写么?这样好像是执行了后台的方法。不过没倒计时的效果了?我的意思是这样: <script type="text/javascript"> var wait=45; document.getElementById("yan").disabled = false; function time(o) { if (wait == 0) { o.removeAttribute("disabled"); o.value="免费获取验证码"; wait = 5; } else { o.setAttribute("disabled", true); o.value="重新发送(" + wait + ")"; wait--; setTimeout(function() { time(o) }, 1000) } } </script> <asp:Button runat=server CssClass="enter" Text="获取验证码" ID="yan" name="yan" OnClientClick="time(this)" OnClick="yan_onClick" style="width:40%;" /> tiem(this) 这个this 是传的button 不知道你想传什么。 可以自己改下 也是学习了一番 这个或许对你有帮助 正解 http://bbs.csdn.net/topics/390438427 BitmapCutter.Core 在IE6 下边 功能按钮会错位 在线等 大家都用哪个版本的Serv-U? 死锁问题 如何获得当前显示的网页在虚拟主机上的物理路径 请问用css或是其它的,怎么把DropDownList控件设置成平面的。 请帮忙看看这是什么错误?? 网页版式设计的问题 求asp.net网上教程,请把网址给我,谢谢!!! 为什么动态创建的控件不能保存? 一个简单的网页问题? asp.net 中怎样截获 目录不存在问题? mvc3. nuget .求解答 .
<script type="text/javascript">
var wait=45;
document.getElementById("yan").disabled = false;
function time(o) {
if (wait == 0) {
o.removeAttribute("disabled");
o.value="获取验证码";
wait = 5;
} else {
o.setAttribute("disabled", true);
o.value="重新发送(" + wait + ")";
wait--;
setTimeout(function() {
time(o)
},
1000)
}
}
onclick=function(){time(this);}
</script> js这样写么?这样好像是执行了后台的方法。不过没倒计时的效果了?
<script type="text/javascript">
var wait=45;
document.getElementById("yan").disabled = false;
function time(o) {
if (wait == 0) {
o.removeAttribute("disabled");
o.value="获取验证码";
wait = 5;
} else {
o.setAttribute("disabled", true);
o.value="重新发送(" + wait + ")";
wait--;
setTimeout(function() {
time(o)
},
1000)
}
}
onclick=function(){time(this);}
</script> js这样写么?这样好像是执行了后台的方法。不过没倒计时的效果了?我的意思是这样:
<script type="text/javascript">
var wait=45;
document.getElementById("yan").disabled = false;
function time(o) {
if (wait == 0) {
o.removeAttribute("disabled");
o.value="免费获取验证码";
wait = 5;
} else {
o.setAttribute("disabled", true);
o.value="重新发送(" + wait + ")";
wait--;
setTimeout(function() {
time(o)
},
1000)
}
}
</script> <asp:Button runat=server CssClass="enter" Text="获取验证码" ID="yan" name="yan" OnClientClick="time(this)" OnClick="yan_onClick" style="width:40%;" />
tiem(this) 这个this 是传的button 不知道你想传什么。 可以自己改下