ajax

来源:互联网 发布:淘宝有意思的小玩意 编辑:程序博客网 时间:2024/05/18 01:37

1
取得运行结果
$("#phone").val()   取得id=phone的input的内容数值

$.post("要执行的文件",{ 传递的变量名:传递的数值, 返回值:Math.random},function(返回值){执行的操

作,可以利用返回值},"text");
--------------------------执行的一个文件例子
phone=formatStr(request("v"),20)
r = api_user_phone_bind_count(phone)

if left(r,1) = "0" then
 if instr(r,"|")>0 then
  r = split(r,"|")(1)
  if isnumeric(r) then
   if cint(r)>=5 then
    r = "1"
   else
    r = "0"
   end if
  else
   r = "-1"
  end if
 else
  r = "-1"
 end if
else
 r = "-1"
end if

if c_mobile(phone)<>"" then
 r = "-2"
end if


Response.Clear()
Response.Buffer = False
Response.Expires = -1
Response.AddHeader "pragma", "no-cache"
Response.AddHeader "cache-control", "private"
Response.CacheControl = "no-cache"
Response.ContentType = "text/plain"
Response.Charset = "GB2312"
response.write(r)
------------------------------------------执行的一个文件例子

 


function nextstep(){
 $("#_btn").attr("disabled","disabled");
 var phone = $('#phone').val();
 var activecode = $('#activecode').val();
 
 if(phone==''){
  alert('请填写要绑定的手机号');
  $("#_btn").removeAttr("disabled");
  return false;
 }else if(activecode==''){
  alert('请填写手机收到的验证码');
  $("#_btn").removeAttr("disabled");
  return false;
 }else{
  window.from1.submit();
  return true;
 }
-----------------------------------------------表单验证的例子<input type="image" id="_btn" 

src="../image2012/xyb.jpg" onClick="return nextstep();" />

0 0
原创粉丝点击