I've googled for a while now and can only find what processData: false
does. I can't find anyone who has experienced this same issue.
I'm passing JSON back to the server and do not want jQuery to automatically convert the data to a query string so I'm setting processData to false. I can see the request firing if I take out processData, but as soon as I put it in I do not see any requests being made (using Firebug & Chrome dev tools).
$.ajax({
url: myUrl,
type: "POST",
data: {foo: "bar"},
processData: false,
contentType: 'application/json'
});
The request I was initially making was a bit more complex than this but I've simplified it to try to narrow down the problem but this simple piece of code does not work either (again, it does work if I comment out processData). Also, I am not seeing any JavaScript errors in the console.
Edit
For future web searchers: As lonesomeday pointed out, jQuery will not throw any errors if you supply either a JS object or an incorrectly formatted JSON string. It will simply not fire the request.
processData:true
, jQuery automatically converts any object passed to `data' to a query string that is appended to the URL when firing the request. Setting it to false, prevents that and therefore allows you to send JSON or other data that you don't want processed. – paz Feb 13 '17 at 15:17processData
does nothing here. When you pass a string todata
(as in this example) jQuery won't process it. – Quentin Oct 19 '17 at 20:17