Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/261.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/82.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
Php Ajax调用始终返回错误函数_Php_Jquery_Ajax - Fatal编程技术网

Php Ajax调用始终返回错误函数

Php Ajax调用始终返回错误函数,php,jquery,ajax,Php,Jquery,Ajax,我有一个php页面,页面显示在一个iframe中,该页面包含一个ajax调用 代码如下所示 $.ajax({ url: "mindex.php", data: { model: "test", handler: "test_123", data: info }, type: "post",

我有一个php页面,页面显示在一个iframe中,该页面包含一个ajax调用 代码如下所示

      $.ajax({
            url: "mindex.php",
            data: {
                model: "test",
                handler: "test_123",
                data: info
            },
            type: "post",
            dataType: "json",
            success: function(response){
                if( response.success ){
                    createChart( response.times );
                }else{
                    $('#chart-container').html( '<p style="margin: 20px 100px; color: rgb(204, 71, 71);">'+response.errors+'</p>' );
                }
            },
            error: function(){
                alert("Unknown error Occured");
            }
        });
$.ajax({
url:“mindex.php”,
数据:{
模型:“测试”,
处理程序:“test_123”,
数据:信息
},
类型:“post”,
数据类型:“json”,
成功:功能(响应){
if(response.success){
createChart(response.times);
}否则{
$(“#图表容器”).html(“

“+response.errors+”

”); } }, 错误:函数(){ 警报(“发生未知错误”); } });
运行此页面后,始终显示“发生未知错误”; Firebug显示无响应(空白)

此页面在我的本地主机中工作,但联机显示错误 请帮帮我


thax提前

调用
ajax
没有问题

mindex.php
必须以
json
格式返回输出


使用echo json_encode($response)在
mindex.php
文件中。

确保您的生产环境中的url是正确的问题在于
mindex.php
中的内容,而不是ajax。检查你的PHP错误日志,它可能会产生一个致命的错误,这将解释空白响应。还请检查响应的返回代码,致命错误将返回
500内部服务器错误
。url正确,响应未显示在firebug中,显示为空白,错误登录中未发现错误使用iframe有任何问题,页面加载在iframe中