jQuery Ajax 使用时调用 PHP Xdebug 挂起 web 应用程序

jQuery Ajax call when using PHP Xdebug hangs web app

当使用 php Xdebug 并发送下面的 ajax 调用时,它会挂起并且永远不会完成。但如果我不使用 Xdebug,它工作正常。

此外,如果我使用 <form action="/controllers/scannerController.php" method="post"> 发送 post 它会起作用。有没有人遇到过这个问题或者可以提供解决方案?

function submitScannedText(){
    jQuery.ajax({
        type: "POST",
        url: '../controllers/scannerController.php',
        data: {text: $("#scannerEntry").val() },
            });
}

你可以尝试在 type: "POST", 下面添加 enctype: 'multipart/form-data', 吗?

Ajax 现在可能会像您的 <form action="/controllers/scannerController.php" method="post"> 一样发送它,PHP 可以用同样的方式处理它。请让我知道它是否有效:)

此外,如果它不起作用,您还应该添加 processData : false,