When using php Xdebug and sending the ajax call below it hangs and never finishes. But if I don't use Xdebug it works fine.
Also, if I use <form action="/controllers/scannerController.php" method="post">
to send the post it works. Has anyone encountered this problem before or can provide a solution?
function submitScannedText(){
jQuery.ajax({
type: "POST",
url: '../controllers/scannerController.php',
data: {text: $("#scannerEntry").val() },
});
}
Can you try to add enctype: 'multipart/form-data',
below type: "POST",
please ?
Ajax will maybe now send it the same way as your <form action="/controllers/scannerController.php" method="post">
do and PHP can handle it the same way. Please let me know if it worked :)
Also if it's not working you should also add processData : false,
.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.