altert/html打印出来的是[object Object]
生活随笔
收集整理的這篇文章主要介紹了
altert/html打印出来的是[object Object]
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
解決方案如下:
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <script src="http://apps.bdimg.com/libs/jquery/2.1.4/jquery.js"></script> <button id="btn">點擊</button><body> <div id="storage"></div> <script>var oss = document.getElementById("ssput");$(function(){$("#btn").click(function(){$.ajax({headers:{Accept:"application/json;charset=utf-8"},url: 'http://127.0.0.1:10072/test_post/aa',type:'GET',dataType: 'jsonp',jsonpCallback: "successCallback",//回調方法success:function(res){var str = JSON.stringify(res); console.log(res);console.log("--------------------");console.log(0);console.log("已經存入該條數據");alert("res="+str);$("#storage").html("已經獲取服務器端的設備參數:"+str); // location.href="http://localhost:10072/register_success"},error:function (res) {console.log(res);console.log(1)}})})}) </script> </script><h1 id="search">Hello World!</h1> </body>?
總結
以上是生活随笔為你收集整理的altert/html打印出来的是[object Object]的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Flask碰到 原因:CORS 头缺少
- 下一篇: 数据仓库相关书籍调研