[C#] JQuery向asp.net ashx提交带中文的参数代码 →→→→→进入此内容的聊天室

来自 , 2019-04-24, 写在 C#, 查看 111 次.
URL http://www.code666.cn/view/9cafd121
  1. //异步获取数据
  2. var tpAction=action+'getSearch.ashx?key='+encodeURIComponent('中国');                                        
  3. $.getJSON(tpAction,function(rsp){//请求成功                                                
  4.         if(rsp.status=='1'){
  5.                 var list=rsp.item;
  6.                 var len=list.length;                                           
  7.                 if(len==0){
  8.                         //没有数据直接返回                                                     
  9.                         setNull();
  10.                         return;
  11.                 }                                              
  12.                 //组装数据                                 
  13.                 var s=zy_tmpl(templ,list,len);                                                 
  14.                 $list.append(s);
  15.                 }else{
  16.                         alert('','加载数据失败,请重试','确定');                                   
  17.                 }
  18.                                                
  19.         },'json',function(err){//请求失败
  20.                 alert('','加载失败,请检查网络设置!','确定');                                          
  21.      },'POST','');
  22.  
  23.  
  24.  
  25. //csharp/6106

回复 "JQuery向asp.net ashx提交带中文的参数代码"

这儿你可以回复上面这条便签

captcha