jquery ajax 访问接口或者后台函数

 1 let par1 = {};
 2         par1.id = sid;
 3         let data1 = JSON.stringify(par1);
 4 
 5          $.ajax({
 6             method: 'POST',
 7             url: '../oneMap/GetDeviceStatus',
 8             contentType: 'application/json; charset = UTF-8',
 9             dataType: 'json',
10             data: data1
11 
12         })
13         .done(function (msg) {
14 
15             let jsonData = msg.data;
16 
17             console.log(new Date() + "设备状态:" + jsonData);
18 
19             let sjJson = jsonData.data;
20 
21             setData(sjJson);
22 
23         });

 

posted @ 2020-08-04 11:22  googlegis  阅读(552)  评论(0编辑  收藏  举报

坐标合肥,非典型GIS开发人员 GitHub