代码如下
$(function() {
var quanju;
var dataIndex;
$.ajax({
type:'POST',
url: 'hhWebsiteInfoController.do?website-getDt',
dataType:'json',
data:'',
success:function(json){
alert(1);
dts = json.attributes.dts;
$("#news").empty();
quanju=dts;
if(typeof(dts)!=undefined){
for(var i=0;i
var a = "
"+dts[i].title+"
";
var b = "
// var d = "
"+quanju[i].summary+"
";
var c = a+b;
$("#news").append(c);
}
}}
});
$(document).on('click',".test2",function() {
layer.open({
type: 1,
area: ['600px', '360px'],
shadeClose: true, //点击遮罩关闭
content: '
'+quanju[dataIndex].summary+'
'
});
});
});
点击图片链接弹出层显示图片字段所在记录的其他字段,如summary 但是summary找不到,不是全局变量的问题?