当前位置: 移动技术网 > IT编程>网页制作>CSS > Ajax请求后端数据解析

Ajax请求后端数据解析

2018年09月20日  | 移动技术网IT编程  | 我要评论

ajax请求后端数据

<script src="https://code.jquery.com/jquery-3.3.1.min.js"></script><script type="text/javascript"> function sendajaxpost(){ let json = { username: "lindont", password: "123456" } $.ajax({ type: "post", url: "https://localhost:8787/test/params", contenttype: "application/json; charset=utf-8", data: json.stringify(json), /*传给后端的数据格式json*/ datatype: "json", /*后端返回的数据格式json*/ success: function(data){ console.log(data); }, error: function (message) { } }); } function sendajaxget() { $.ajax({ type: "get", url: "https://localhost:8787/test", success: function(data){ console.log(data); }, error: function (message) { } }); } </script>

如对本文有疑问, 点击进行留言回复!!

相关文章:

验证码:
移动技术网