惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

博客园 - 叶小钗
云风的 BLOG
云风的 BLOG
G
Google Developers Blog
S
SegmentFault 最新的问题
罗磊的独立博客
Hugging Face - Blog
Hugging Face - Blog
美团技术团队
爱范儿
爱范儿
博客园 - 三生石上(FineUI控件)
H
Hackread – Cybersecurity News, Data Breaches, AI and More
D
DataBreaches.Net
F
Fortinet All Blogs
TaoSecurity Blog
TaoSecurity Blog
D
Docker
C
Cybersecurity and Infrastructure Security Agency CISA
K
Kaspersky official blog
宝玉的分享
宝玉的分享
腾讯CDC
Google Online Security Blog
Google Online Security Blog
Recorded Future
Recorded Future
T
The Exploit Database - CXSecurity.com
T
The Blog of Author Tim Ferriss
V
V2EX
S
Securelist
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
C
CERT Recently Published Vulnerability Notes
A
Arctic Wolf
Scott Helme
Scott Helme
L
LINUX DO - 热门话题
Y
Y Combinator Blog
P
Proofpoint News Feed
T
Tor Project blog
AWS News Blog
AWS News Blog
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
The Last Watchdog
The Last Watchdog
博客园 - 聂微东
T
Threat Research - Cisco Blogs
B
Blog
Attack and Defense Labs
Attack and Defense Labs
L
Lohrmann on Cybersecurity
C
CXSECURITY Database RSS Feed - CXSecurity.com
阮一峰的网络日志
阮一峰的网络日志
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
IT之家
IT之家
N
News and Events Feed by Topic
博客园 - 司徒正美
H
Help Net Security
C
Cisco Blogs
C
Check Point Blog
S
Secure Thoughts

博客园 - 朱小能

C#对Dictionary的按Value排序 linq to sql中的自动缓存(对象跟踪) 修改域名映射IP地址 SQL 语句,类型转换 hyper-v 网络连接 VS2010 定位文件在solution中的位置 oracle连接字符串配置 spool的简单使用 open数据库Timeout expired 错误 文件的还原与备份 - 朱小能 - 博客园 ASCII码,对应e.KeyChar C# 调用计算器,日历 - 朱小能 - 博客园 Excel 如何由一个文本算术公式得到一个结果 Word、Excel中输入当前日期及时间的快捷键 c# ToString 格式化数字 - 朱小能 GridView绑定 获取access中表的相关信息 Filelog - 朱小能 - 博客园 List<T> 排序 - 朱小能 - 博客园
javascript 调用webservice 的几种方法
朱小能 · 2013-03-04 · via 博客园 - 朱小能

1.

         Sys.Net.WebServiceProxy.invoke(
                          'WebService Path',//Service路径
                          'IsSubmitByURL',//调用方法
                          true,//是否使用HttpGet
                          {'name':name},//参数
                          Onsucceeded,//OnSucceeded时回调函数
                          null,//OnFailed时回调函数
                          null,//UserContext
                          5000//TimeOut
                          );

         function Onsucceeded(){ //todo}

         http://technet.microsoft.com/zh-cn/library/bb383814(es-es).aspx

2.

          xmlhttp=null;
                          if (window.XMLHttpRequest)
                          {// code for all new browsers
                          xmlhttp=new XMLHttpRequest();
                          }
                          else if (window.ActiveXObject)
                          {// code for IE5 and IE6
                          xmlhttp=new ActiveXObject('Microsoft.XMLHTTP');
                          }
                          if (xmlhttp!=null)
                          {
                          
                          var path =  '/DoWork?name='+ encodeURI(name); //webservice路径
                          xmlhttp.open('GET',path,false);  //false同步,true异步
                          xmlhttp.setRequestHeader('Content-Type','application/json; charset=utf-8');
                          xmlhttp.send(null);
                          //alert('xmlhttp.responseXML:'+xmlhttp.responseText);
                          result= xmlhttp.responseText;  //返回结果
                          }
                          else
                          {
                          alert('Your browser does not support XMLHTTP.');
                          } 

3.

 $("#btnClick").click(function() {
                 $.ajax({
                      url:"http://localhost:10168/WebService1.asmx/HelloWorld",
                      beforeSend: function(x) { 
                       x.setRequestHeader("Content-Type", "application/json; charset=utf-8"); 
                     },

       async: false,
                   data: "{code:'"+Code+"'}",

                     dataType:"json",
                     type:"POST",
                     error: function(x, e) { 
                   alert(x.responseText); 
                 }, 
          complete: function(x) { 
                       //alert(x.responseText); 
                 } ,
                     success:function(data){
                        var msg=data.d;
                      var json=JSON2.parse(msg);
                        alert(json.id);
                     }
                 });
                 
             });