这里使用到$.getJSON()方法为什么不能执行回调函数啊???后台逻辑正确传过来的json格式为:{message:"success",code:0,path:"D:\XH120730001.pdf"}
执行回调函数取出路径,但是现在是回调函数不执行啊??哪位师傅给看看啊??谢谢啦!! },'-',{
id:'btnprint',
text:'导出PDF文件',
iconCls:'icon-print',
handler:function(){
window.qcySalesSlip.print();
var tempDatagrid = $('#qcySalesSlipDatagrid');
var index = tempDatagrid.datagrid('getSelected');
if(!index) {
$.messager.alert('提示','请选择操作行');
return;
}
$.getJSON('qcy/QcySalesSlip.do?action=getlistPDF&id='+index.id+'&randomData='+Math.random(),function(json){
$.messager.alert('提示1','请选择操作行1');
                        }
);
/** $('div#tempselect').remove();
$('<div id="tempselect"><span>请选择点击下面的按钮进行操作</span></div>').appendTo(document.body).dialog({
title:'是否导出PDF文件',
modal:true,
height:100,
width:300,
closable:true,
buttons:[{
text:'确定',
iconCls:'icon-save',
handler:function(){$('#tempselect').dialog('close');
window.open('qcy/QcySalesSlip.do?action=savepdfDocument&id='+id+'&pdfName='+pdfName);
}
}],
iconCls:'icon-save'
});**/
}//handler
},'-',{

解决方案 »

  1.   

    'qcy/QcySalesSlip.do?action=getlistPDF&id='+index.id+'&randomData='+Math.random()
    这段东西打印出来,贴在浏览器里看看是否正常运行了没进回调函数多半是服务器处理有问题或者你有IE8+或者FF之类的话,开控制台拦截访问请求,看看请求响应情况
      

  2.   

    有一种情况是因为 json格式有问题去json的测试工具里面测试看看就知道。 就是连接的url里面的json格式不正确。  我就遇到了这种情款