doedje / jquery.soap

This script uses $.ajax to send a SOAP:Envelope. It can take XML DOM, XML string or JSON as input and the response can be returned as either XML DOM, XML string or JSON too.
352 stars 148 forks source link

General issue - Bad in cross-domain url calls #99

Closed miguoliang closed 8 years ago

miguoliang commented 8 years ago

I read #80 and it doesn't work in my tests. After reading documents of $.ajax, I found a solution for cross-domain url request.

I added these codes below and it works in IE 11+、Edge、Chrome. And I hope it's useful, thanks.

                xhrFields: {
                    // Add xhrFields, and set xhrFields.withCredentials = true by default, otherwise,
                    // it can't send a cross-domain request successfully in Chrome without this settings.
                    // You can use it to set withCredentials to true for cross-domain requests if needed.
                    // More about it is in jQuery official website. (http://api.jquery.com/jquery.ajax/).
                    // I hope it's useful and tested in Chrome & IE 11+ & IE Edge, Thanks.
                    withCredentials: true
                }

Version:

jQuery version: 1.11.x & 3.x jQuery.query version: 1.6.7

miguoliang commented 8 years ago

Please check my pull request #100 , thanks. @doedje

doedje commented 8 years ago

THANX for the PR! review the code at the moment!