Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>The reason you are getting that weird error message is that the error callback for the jQuery ajax function takes 3 arguments instead of 1, as described in the docs here: <a href="http://api.jquery.com/jQuery.ajax/" rel="nofollow">http://api.jquery.com/jQuery.ajax/</a></p> <p>The first argument is a jQuery-special XMLHttpRequest object, which has a property called <code>error</code> that contains the function you are seeing logged to your console. The actual error that occurred during execution of your ajax call is the passed in to the error callback as the 3rd argument.</p> <p>To see it, you should do something like:</p> <pre><code>$(document).ready(function(){ $.ajax({ type:"POST", url:"getStores.php", dataType: "json", success:function(data){ results(data); }, error: function(jqXHR, text, error) { console.log(error); } }); }); </code></pre> <p>That will get you closer to the real problem.</p> <p>UPDATE:</p> <p>Please show the output from your php script. It may be that it is not returning valid json. As noted in the php docs ( <a href="http://php.net/manual/en/function.json-encode.php" rel="nofollow">http://php.net/manual/en/function.json-encode.php</a> ), <code>[json_encode] only works with UTF-8 encoded data.</code></p> <p>You might also check in to <code>json_last_error</code> ( <a href="http://php.net/manual/en/function.json-last-error.php" rel="nofollow">http://php.net/manual/en/function.json-last-error.php</a> ) to see if the encoding failed for some reason. </p> <p>UPDATE 3:</p> <p>It seems like your problem may be the path to the php script. </p> <p>try it with:</p> <pre><code>$(document).ready(function(){ $.ajax({ type:"POST", url:"/getStores.php", // &lt;-- notice the leading slash!!! //dataType: "json", success:function(data){ //results(data); console.log(data); }, error: function(jqXHR, text, error) { console.log(error); } }); }); </code></pre> <p>or, putting it all back together if the above logs the correct json output to the console...</p> <pre><code>$(document).ready(function(){ $.ajax({ type:"POST", url:"/getStores.php", dataType: "json", success:function(data){ results(data); }, error: function(jqXHR, text, error) { console.log(error); } }); }); </code></pre>
 

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