js带参数调用后台方法
<scripttype="text/javascript">varwait=60;functiontime(o){if(wait==0){o.removeAttribut...
<script type="text/javascript">
var wait = 60;
function time(o) {
if (wait == 0) {
o.removeAttribute("disabled");
o.value = "免费获取验证码";
wait = 60;
} else {
if (document.getElementById('txtPhone').value == "") {
alert("请填写手机号码!");
document.getElementById('txtPhone').focus();
} else {
if (wait == 55){
//触发短信发送方法
var phoneNo = document.getElementById('txtPhone').value
//--------------这里怎么写才能调用Net代码中ShowMsg(string str)这个方法-------------------
}
o.setAttribute("disabled", true);
o.value = "重新发送("+ wait +")";
wait--;
setTimeout(function () {
time(o)
},
1000)
}
}
}
document.getElementById("btn").onclick = function () { time(this); }
</script>
asp.net 代码
public string ShowMsg(string str)
{
return str;
} 展开
var wait = 60;
function time(o) {
if (wait == 0) {
o.removeAttribute("disabled");
o.value = "免费获取验证码";
wait = 60;
} else {
if (document.getElementById('txtPhone').value == "") {
alert("请填写手机号码!");
document.getElementById('txtPhone').focus();
} else {
if (wait == 55){
//触发短信发送方法
var phoneNo = document.getElementById('txtPhone').value
//--------------这里怎么写才能调用Net代码中ShowMsg(string str)这个方法-------------------
}
o.setAttribute("disabled", true);
o.value = "重新发送("+ wait +")";
wait--;
setTimeout(function () {
time(o)
},
1000)
}
}
}
document.getElementById("btn").onclick = function () { time(this); }
</script>
asp.net 代码
public string ShowMsg(string str)
{
return str;
} 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询