Note that there are some explanatory texts on larger screens.

plurals
  1. POAJAX failing silently
    primarykey
    data
    text
    <p>I am having a problem with one of my AJAX requests. All of this was working earlier, then I moved some files around in folders, and it must have broken something, but I have been unable to figure out what may be wrong with my pathing.</p> <p><strong>What is happening</strong></p> <p>AJAX request seems to be being ignored, nothing goes to console or the network tab, responseText is "", and I put a break point in the first line of the PHP which is never hit. It goes straight from <code>$.ajax</code> to the first line in my error callback. Additionally, when this PHP code is called by going straight to the page, or cron, it works fine.</p> <p>I have a very similar call later to another file in the same folder that is working just fine.</p> <p><strong>What I have tried</strong></p> <p>As mentioned before, I have looked at responseText, console output, network tab, and breakpoints in my PHP (which are never reached), and I have looked around Google and stackoverflow. If I intentionally change the name to a non-existing file, I promptly get an error in the console.</p> <p>Code below</p> <pre><code> $.ajax({ type: "POST", url: "PHP/myFile.php", data: '', success: function () { //Success code }, error: function (xhr) { var response = xhr.responseText; // response is "" //Error code } }); </code></pre> <p>Any ideas?</p> <p>Here is the code, later in the file, which (successfully) grabs code from a file in the same folder.</p> <pre><code>$.ajax({ type: "GET", cache: false, url: "PHP/myOtherFile.php", dataType: 'json', success: function (data) { // Success code }, error: function () { // Error Code } }); </code></pre> <p>Pretty basic AJAX calls, not sure what is going on :/</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload