dongmeirang4679 2019-05-29 22:50
浏览 170

使用AJAX时,Xdebug不会在断点处停止

I am trying to run a PHP script through AJAX and when I run the AJAX code (auto runs when page loads). I am using Xdebug and VSCode (which is listening for xdebug) to debug my code at my break points. But when I load the page it ignores my breakpoints.

I should also mention that the PHP script is including another PHP script with a class I need, and its that class that I have placed the break points at, I don't know if that is the problem.

I have tried putting the break points into different areas, and I have put xdebug.remote_autostart = on into my php.ini and it still doesn't work.

let type = $('#categories').val();
    $.ajax({
        url: `php/admin_categories.php?subcat=true&category=${type}`,
        type: 'get',
        success: function(pre_result) {
            console.log(pre_result);
            let result = $.parseJSON(pre_result);
            for (let i = 0; i < result.length; i++) {
                $('#sub_cat').append(
                    `<option value="${result[i].abbr}">${result[i].name}</option>`
                );
            }
        }
    });
  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 微信会员卡等级和折扣规则
    • ¥15 微信公众平台自制会员卡可以通过收款码收款码收款进行自动积分吗
    • ¥15 随身WiFi网络灯亮但是没有网络,如何解决?
    • ¥15 gdf格式的脑电数据如何处理matlab
    • ¥20 重新写的代码替换了之后运行hbuliderx就这样了
    • ¥100 监控抖音用户作品更新可以微信公众号提醒
    • ¥15 UE5 如何可以不渲染HDRIBackdrop背景
    • ¥70 2048小游戏毕设项目
    • ¥20 mysql架构,按照姓名分表
    • ¥15 MATLAB实现区间[a,b]上的Gauss-Legendre积分