结局jquery.getJson 传递参数 转义的问题
JS/JQUERY(5)——Jquery前后台交互

 
 
function testget(){
      $.ajax({
      async:true,
      cache:false,//默认是true 使用缓存
      success:function(result){
        alert(result);
    },
      type:"get",
      data:"uname=zhangsan&realname="+encodeURIComponent("张三三"),
    url:"HelloServlet"
 });
}
function testpost(){
     $.ajax({
     async:true,
     cache:false,
     success:function(result){
       alert(result)
   },
     type:"post",
     data:"uname=zhangsan&realname="+encodeURIComponent("张三三"),
   url:"HelloServlet"
 });
}
function testGet(){
         $.get("HelloServlet","uname=zhangsan&realname="+encodeRUIComponent("张三三")+"&random="+Math.random(),function(result){
         alert(result);
 });
}
function testPost(){
       $.post("HelloServlet","uname=zhangsan&realname=张三三",function(result){
       alert(result);
 });
}

 

相关文章:

  • 2022-01-23
  • 2021-07-05
  • 2021-11-01
  • 2021-06-28
  • 2021-09-26
  • 2021-09-26
猜你喜欢
  • 2021-06-09
  • 2021-05-30
  • 2022-02-23
  • 2021-11-11
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案