Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ajax/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在Joomla 2.5中设置标头时,Ajax调用导致PHP脚本出错_Php_Ajax_Joomla2.5 - Fatal编程技术网

在Joomla 2.5中设置标头时,Ajax调用导致PHP脚本出错

在Joomla 2.5中设置标头时,Ajax调用导致PHP脚本出错,php,ajax,joomla2.5,Php,Ajax,Joomla2.5,在Joomla 2.5中,当ajax函数调用该脚本时,PHP脚本在下面的一行中止 JResponse::setHeader( 'Content-Disposition', 'attachment; filename="example.json"' ); ajax调用如下所示 jQuery.ajax({ data: 'groupid='+group_id, type: 'post', url: "/index.php?option=com_example&view

在Joomla 2.5中,当ajax函数调用该脚本时,PHP脚本在下面的一行中止

JResponse::setHeader( 'Content-Disposition', 'attachment; filename="example.json"' );
ajax调用如下所示

jQuery.ajax({
    data: 'groupid='+group_id,
    type: 'post',
    url: "/index.php?option=com_example&view=default&format=json",
    success: function(data) {
        if (0 == data)
            addFormField(format_date);
        else {
            data_calculator = data;
            jQuery(document).ready(function() {
                initFields();
                });
        }
    },
    error: function(jqXHR, textStatus, errorThrown) {}
});

在Joomla 1.6中,它仍在工作。另外,当使用PHP函数头(…)设置头时,我也会遇到相同的错误。出了什么问题?

您遇到了什么错误?您是否已打开“错误报告”=E\u ALL或将“显示错误”设置为“开”?相同的错误表示您遇到了什么错误?请提及that@cillosiserror\u reporting=E\u ALL已设置为on,display\u errors=on未更改任何内容。不幸的是,我没有得到任何答案。状态为:中止的Firebug结果。但我刚刚意识到这是一个帖子,而不是一个GET。