当前位置:编程学习 > asp >>

用asp+jquery写的一个ajax小程序,不知怎么回事儿,返回值是jquery里边的那个html的源码。

ajax.html: <html> <head><title>t7</title> <script type="text/javascript" src="jquery-1.6.2.js"></script> <script type="text/javascript"> $(document).ready(function(){ $("#send").click(function(){ $.ajax({ type:"get", URL:"http://localhost/jquery/ajax.asp", dataType:'text', data:"{id:7}", success: function(data, textStatus){ alert(data); } }); }); }); </script> </head> <body> <input type="button" value="send" id="send"/> </body> </html> ajax.asp: <% id=request("id") t="small" if id>3 and id<8 then t="middle" else t="big" end if response.write(t) return; %>
追问:asp里边的return;我去掉之后没有问题,直接运行http://localhost/jquery/ajax.asp可以,我用
$(document).ready(function(){
    $("#send").click(function(){
    	  $.get("ajax.asp",{Action:"get",id:"9"},function (data,textStatus){
    	  	alert(data);
      });
});
  });
这种方式运行,能出结果,但是另外一种还是不行。
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,