调试PHP中的Ajax请求的最佳调试工具 [英] Best debug tool to debug Ajax request in PHP

查看:70
本文介绍了调试PHP中的Ajax请求的最佳调试工具的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

什么是在PHP中调试AJAX请求的最佳调试工具?我想检查在调用AJAX函数时是否已触发 class.php 中的方法.

What is the best debug tool to debug AJAX request in PHP? I want to check whether the method in the class.php has been fired when the AJAX function is calling.

例如:

$.ajax({
    url: 'classes/MyClass.php/GetItems',
    data: {
        'catgry': cat
    },
    dataType: 'json',
    success: function (data) {
        alert("data recived!");
    },
    error: function (jqxhr, textStatus, errorThrown) {
        alert("error");
    }
});

MyClass.php

public function GetItems($catgry) {
   $ret = $itmObj->GetItemsByCat($catgry);
   return $ret;
}

推荐答案

简单的方法是在浏览器本身中查看触发器.

The simple way is view the trigger in browser itself.

在Chrome浏览器中打开网站

Open the website in chrome browser

  • 单击F12.

  • Click F12.

单击网络"选项卡.重新加载页面以查找所有文件 正在加载.

Click on Network tab. Reload the page to find all the files getting loaded.

选择MyFile.php,然后单击响应"选项卡以查看您的响应.

select the MyFile.php and then click on the response tab to see ur respone.

您还可以通过此方法查看其他详细信息,例如响应时间,启动程序文件等.

You can also see other details like time taken for response, initiator file etc. by this method.

这篇关于调试PHP中的Ajax请求的最佳调试工具的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆