1 <!DOCTYPE html>
2 <html xmlns="http://www.w3.org/1999/xhtml">
3 <head>
4 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
5 <meta http-equiv="Access-Control-Allow-Origin" content="*" />
6 <title></title>
7 <script src="https://cdn.bootcss.com/jquery/3.3.1/jquery.min.js"></script>
8 <script type="text/javascript">
9 $(function () {
10 $("#getdata").click(function () {
11 var dataStock = { taskCode: "2418", ACTUAL_START: "", ACTUAL_END: "" };
12 $.ajax({
13 url: "http://localhost:16340/webService/eCimsService.asmx/GetTaskInfo",
14 type: 'POST',
15 data:'jsonDate='+JSON.stringify(dataStock),
16 success: function (res) {
17 var js =JSON.parse($(res).text()) //将xml转json
18 debugger;
19 console.log(js.success);
20 },
21 error: function (err) {
22 debugger;
23 console.log(err);
24 }
25 });
26 });
27 });
28 </script>
29 </head>
30 <body>
31 <a id="getdata" href="javascript:void(0);">获取webservice数据</a>
32 <div id="data"></div>
33 </body>
34 </html>