将json对象序列化。使用JSON.stringfy()函数或者双引号形式的字符串。
<script>
var dd = {'detectIDs':'T001460032'};
$.post("http://localhost:8911/gen_report",JSON.stringify(dd),
function (data, status) {
for (x in data) {
document.write(data[x] + "<br>");
}
});
</script>
本文介绍了一种将JSON对象序列化的方法,通过使用JSON.stringify()函数实现数据的发送请求。示例代码展示了如何通过POST方式向指定URL发送序列化的JSON数据,并接收服务器返回的数据。
494

被折叠的 条评论
为什么被折叠?



