Merge pull request #235 from tomconroy/patch-cors

Patch Snap.ajax to allow CORS GET requests
master
Dmitry Baranovskiy 2014-05-06 10:25:44 +10:00
commit 83100d6f71
1 changed files with 1 additions and 1 deletions

View File

@ -3375,8 +3375,8 @@ Snap.ajax = function (url, postData, callback, scope){
postData = pd.join("&");
}
req.open((postData ? "POST" : "GET"), url, true);
req.setRequestHeader("X-Requested-With", "XMLHttpRequest");
if (postData) {
req.setRequestHeader("X-Requested-With", "XMLHttpRequest");
req.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
}
if (callback) {