Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>You are sending "params" in js: <code>request.send(params);</code></p> <p>but "data" in jquery". Is data defined?: <code>data:data,</code></p> <p>Also, you have an error in the URL: </p> <pre><code>$.ajax( {url:url, type:"POST", dataType:"json", data:data, success:function(data, textStatus, jqXHR) {alert("success");}, error: function(jqXHR, textStatus, errorThrown) {alert("failure");} }); </code></pre> <p>You are mixing the syntax with the one for $.post</p> <hr> <p><strong>Update</strong>: I was googling around based on monsur answer, and I found that you need to add <code>Access-Control-Allow-Headers: Content-Type</code> (below is the full paragraph)</p> <p><a href="http://metajack.im/2010/01/19/crossdomain-ajax-for-xmpp-http-binding-made-easy/" rel="noreferrer">http://metajack.im/2010/01/19/crossdomain-ajax-for-xmpp-http-binding-made-easy/</a></p> <blockquote> <p>How CORS Works</p> <p>CORS works very similarly to Flash's crossdomain.xml file. Basically, the browser will send a cross-domain request to a service, setting the HTTP header Origin to the requesting server. The service includes a few headers like Access-Control-Allow-Origin to indicate whether such a request is allowed.</p> <p>For the BOSH connection managers, it is enough to specify that all origins are allowed, by setting the value of Access-Control-Allow-Origin to *. The Content-Type header must also be white-listed in the Access-Control-Allow-Headers header.</p> <p>Finally, for certain types of requests, including BOSH connection manager requests, the permissions check will be pre-flighted. The browser will do an OPTIONS request and expect to get back some HTTP headers that indicate which origins are allowed, which methods are allowed, and how long this authorization will last. For example, here is what the Punjab and ejabberd patches I did return for OPTIONS:</p> <pre><code>Access-Control-Allow-Origin: * Access-Control-Allow-Methods: GET, POST, OPTIONS Access-Control-Allow-Headers: Content-Type Access-Control-Max-Age: 86400 </code></pre> </blockquote>
    singulars
    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.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      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