Note that there are some explanatory texts on larger screens.

plurals
  1. POWhy is IE 10 Refusing to send POST data via jQuery $.ajax
    primarykey
    data
    text
    <p>Both in my development and production environment, IE 10 is refusing to send any POST data via a simple $.ajax call.</p> <p>My script looks like this:</p> <pre><code>d = 'testvar=something'; $.ajax({ data: d, success: function(h){ console.log(h); } }); </code></pre> <p>The actual ajax request is going through, but no post data???</p> <p>The request headers look normal:</p> <pre><code>Request POST /steps/~do HTTP/1.1 Accept */* Content-Type application/x-www-form-urlencoded; charset=UTF-8 X-Requested-With XMLHttpRequest Referer http://localhost:8080/steps/ Accept-Language en-GB,en-AU;q=0.7,en;q=0.3 Accept-Encoding gzip, deflate User-Agent Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.2; WOW64; Trident/6.0) Host localhost:8080 Content-Length 0 DNT 1 Connection Keep-Alive Cache-Control no-cache </code></pre> <p>But the request body is empty! (I'm using IE's network tab in their F12 dev bar to capture requests). In the PHP script, <code>print_r($_POST);</code> returns an empty array.</p> <p>This works fine in IE 7 - 9, chrome, FF and safari, but breaks in IE10?</p> <p>I'm not sure if I've missed something, or if IE 10 is just buggy?</p> <p><em>EDIT</em></p> <p>I've set the global ajax settings as follows:</p> <pre><code>$.ajaxSetup({ url: ROOT+'~do', // ROOT is either http://localhost/.../~do or http(s)://www.steps.org.au/~do depending on production or development environment type: 'POST' }); </code></pre> <p><strong>Further Edit</strong></p> <p>Using IE version 10.0.9200.16384 on Windows 8 Pro 64 bit</p> <p>Direct copy/paste of request headers are:</p> <pre><code>Key Value Accept */* Accept-Encoding gzip, deflate Accept-Language en-GB,en-AU;q=0.7,en;q=0.3 Cache-Control no-cache Connection Keep-Alive Content-Length 0 Content-Type application/x-www-form-urlencoded; charset=UTF-8 Cookie __utma=91949528.1947702769.1348201656.1353212510.1353237955.6; __utmz=91949528.1348201656.1.1.utmcsr=localhost|utmccn=(referral)|utmcmd=referral|utmcct=/coconutoil.org.au/; __utmb=91949528.2.10.1353237955; __utmc=91949528; cartID=8b3b2b9187cfb1aeabd071d6ec86bbbb; PHPSESSID=bl57l7fp0h37au7g0em7i3uv13 DNT 1 Host www.steps.org.au Referer https://www.steps.org.au/ Request POST /~do HTTP/1.1 User-Agent Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.2; WOW64; Trident/6.0) X-Requested-With XMLHttpRequest </code></pre> <p>The Request body is emtpy.</p> <p>Reponse headers:</p> <pre><code>Key Value Response HTTP/1.1 200 OK Server nginx/0.7.65 Date Sun, 18 Nov 2012 11:23:35 GMT Content-Type text/html Transfer-Encoding chunked Connection close X-Powered-By PHP/5.3.5-1ubuntu7.2ppa1~lucid Expires Thu, 19 Nov 1981 08:52:00 GMT Cache-Control no-store, no-cache, must-revalidate, post-check=0, pre-check=0 Pragma no-cache </code></pre> <p>Initiator</p> <pre><code>Property Value Stage Document Processing Element XMLHttpRequest Action Processing Document ID 0 Frame ID 0 Frame URL https://www.steps.org.au/Shop/Health-Products/ </code></pre> <p>Page which replicates the problem (the entire site actually):</p> <p><a href="https://www.steps.org.au/Shop/Health-Products/" rel="noreferrer">Steps to Life Shop, Health Products</a></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.
 

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