返回Json或object,导致bug,使用eval函数处理
来源:互联网 发布:westlife知乎 编辑:程序博客网 时间:2024/06/05 13:34
function news(id){
$.ajax({
type : "POST",
url:"${path}/bulletinNews/newsDetail.do",
dataType: 'json',//返回数据的类型
data:{id:id},
success:function (data) {
data=eval('('+data+')');
$("#newsDetail").html("");
var html = "<div class='popup_top'><span></span><b class='popup_title'>"+data.title+"</b></div>";
html += "<div class='popup_main'><div class='popup_txt align_center'>"+data.content+"</div></div>";
html += "<div class='popup_bottom align_center'><input type='reset' onclick='exit();' value='关闭'/></div>";
$("#newsDetail").append(html);
$("#newsDetail").show();
}
});
$.ajax({
type : "POST",
url:"${path}/bulletinNews/newsDetail.do",
dataType: 'json',//返回数据的类型
data:{id:id},
success:function (data) {
data=eval('('+data+')');
$("#newsDetail").html("");
var html = "<div class='popup_top'><span></span><b class='popup_title'>"+data.title+"</b></div>";
html += "<div class='popup_main'><div class='popup_txt align_center'>"+data.content+"</div></div>";
html += "<div class='popup_bottom align_center'><input type='reset' onclick='exit();' value='关闭'/></div>";
$("#newsDetail").append(html);
$("#newsDetail").show();
}
});
}
data=eval('('+data+')');//通过eval函数对data进行处理
阅读全文
0 0
- 返回Json或object,导致bug,使用eval函数处理
- JS中eval()函数处理返回的json数据
- PHP中使用了mcrypt_decrypt函数处理Json串后导致Json_decode返回null问题
- eval函数JSON字符串转Object
- JS eval()函数处理json字符串
- 【Ajax】[bug] 页面 eval() 处理 Json 数据报错
- js使用eval来转换JSON字符到Object
- eval解析JSON中的注意点 在JS中将JSON的字符串解析成JSON数据格式,一般有两种方式: 1.一种为使用eval()函数。 2. 使用Function对象来进行返回解析。 使用eval
- js eval处理json
- 关于 Ajax中返回json类型数据为什么使用? eval()
- 利用eval()处理返回的json字符串,json字符串转换为json
- jersey 返回结果中的object不能解析xml或json
- json中的eval函数
- eval函数和JSON
- json eval函数解析
- js中eval函数对json格式数据的处理
- js中eval函数对json格式数据的处理
- python3下使用map()函数返回<map object at 0x00000000038327F0>导致不能直接使用的解决办法
- Android环境搭建及Monkey入门
- jquery查找节点和创建节点的方式
- 异常org.springframework.beans.factory.UnsatisfiedDependencyException
- UVA 1339(古老的密码)
- 数据库相关的优化
- 返回Json或object,导致bug,使用eval函数处理
- 避免启动container运行shell脚本执行完成后docker退出
- https 原理
- 手势估计- Hand Pose Estimation
- Ice的更多细节
- 机器学习算法python实现
- Apache Strom学习笔记三:在storm集群上运行拓扑
- JAVA与mysql之间的编码问题
- 利用nginx搭建RTMP视频点播、直播、HLS服务器