Note that there are some explanatory texts on larger screens.

plurals
  1. POjQuery ajax fails for unknown reason
    text
    copied!<p>I'm calling a function like this:</p> <pre><code>function(activeOnly, callback) { debug("$.support.cors: {0}".format($.support.cors)); debug("getting data({0})".format(activeOnly)); debug("{0}/data/".format(this._api_root)); $.ajax({ url: "{0}/data/".format(this._api_root), data: { generaldata: !activeOnly }, dataType: "json", headers: { authorization: this._auth_header }, success: function (data, code, jqx) { debug("data request succeeded with {0}".format(data)); result = data; }, error: function(jqx, err, ex) { debug("data request failed with {0}: {1}".format(err, ex)); }, complete: function(jqx, status) { debug("data request completed: {0}".format(status)); } }); </code></pre> <p>In response, the error and complete functions are called, with the resulting output:</p> <pre><code>[6192] MyData: $.support.cors: true [6192] MyData: getting data({0}) [6192] MyData: https://_some_root_/data/ [6192] MyData: data request failed with Unknown: Unknown [6192] MyData: data request completed: Unknown </code></pre> <p>When I monitor using Charles, this is what I get:</p> <pre><code>https://_some_root_/ Failed No request was made. Possibly the certificate was rejected. - HTTP/1.0 CONNECT - /127.0.0.1 _some_root_/_some_ip_address_ 3/31/11 3:15:28 PM - - - - - - - 0.02 KB/s - 366 bytes - - - 366 bytes - - </code></pre> <p>and in the request tab, I can see that my request doesn't even look right (note the lack of an Authorization header):</p> <pre><code>CONNECT _some_root_:443 HTTP/1.0 User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1; Win64; x64; Trident/5.0; .NET CLR 2.0.50727; SLCC2; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C; .NET4.0E; InfoPath.3; Tablet PC 2.0) Host: _some_root_:443 Content-Length: 0 Proxy-Connection: Keep-Alive Pragma: no-cache </code></pre> <p>What gives? There is no prompt for an unrecognized certificate or anything like that - it just fails. (It works fine if I make a GET request in my browser).</p>
 

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