怎么向搜索引擎提交网站,山西营销网站建设联系方式,做户外商城网站,asp网站怎么安装好久没有看JavaWEB项目了突然拿起来#xff0c;而且是原生的项目#xff0c;中JSON 字符串的处理 json.stingfy() 将对象#xff0c;数组转换为字符串#xff0c;json.parse() 将字符串转成json 对象JSON.stringify#xff08;数组或者对象#xff09; JSON.parse(字符串…好久没有看JavaWEB项目了突然拿起来而且是原生的项目中JSON 字符串的处理 json.stingfy() 将对象数组转换为字符串json.parse() 将字符串转成json 对象JSON.stringify数组或者对象 JSON.parse(字符串)详细用法请参考 https://www.cnblogs.com/panmy/p/5925986.html 2. XMLHttpRequest() 请求样例 var xhr new XMLHttpRequest();xhr.open(post,../controllerpath, true);//如果在open 方法中指明是post请求 在send提交之前需要设置Http头设置post格式需要指定xhr.setRequestHeader(Content-type, application/x-www-form-urlencoded); xhr.onreadystatechange function() {//Call a function when the state changes.if(xhr.readyState XMLHttpRequest.DONE xhr.status 200) {//xhr.readyState 4等价于XMLHttpRequest.DONE// 请求结束后,在此处写处理代码//alert(xhr.responseText);var responseText xhr.responseText;//返回结果var obj JSON.parse(responseText); if(obj[FLAG]SUCCESS){var data obj[rest];alert(JSON.stringify(data));initField(data)}}}xhr.send(参数1参数值1变量参数2参数值2变量参数3参数值3变量); 参考:https://www.cnblogs.com/panmy/p/5925986.html