xdomainrequest

Any way to simulate a *synchronous* XDomainRequest (XDR) request

天大地大妈咪最大 提交于 2019-12-10 19:38:50
问题 We're making a cross domain call to the google maps geocode API. This was and is working all fine and dandy in modern browsers, but it wasn't working at all in IE8. Looks like it would fail in IE9 as well (partial CORS support). This led to including a XDomainRequest (XDR) to take care of IE8-9. Doing that worked fine in my standalone test to get data back in IE8. The problem I'm running into now is XDR only works asynchronously so my geocode function returns before my xdr.onload fires. In my

jQuery $.ajax extension XDomainRequest onprogress

霸气de小男生 提交于 2019-12-07 19:46:00
问题 The short version: I want to get this to work with this: The long version: I want to create a jQuery extension that adds a progress method to the $.ajax object and which works with IE8 & IE9's XDomainRequest object. Currently, using the above plugins, I can only define progress event callback handlers for XMLHttpRequest objects. However, XDomainRequest also provides an onprogress event. I basically need a wrapper for XDomainRequest. Eg. progressEvent.length would correspond to xdr

XDomainRequest problem

て烟熏妆下的殇ゞ 提交于 2019-12-05 05:12:37
I'm trying to make a asynchronous call to a service that returns json using XDomainRequest (IE8). The problem is that i always get an error (the onerror event is fired, and the responseText is always null), i'm using fiddler to check the response of the service and i seems right (I can see the json object returnig), this only happen in IE8 when using XDomainRequest, the same functionality implemented in JQuery works fine. Any clue would be appreciated. Thanks! P.S.: This is my javascript code: ..... if (jQuery.browser.msie && window.XDomainRequest) { //Use Microsoft XDR var xdr = new

Is there a XDomainRequest equivalent in Firefox?

末鹿安然 提交于 2019-12-03 12:03:01
问题 Is there an equivalent to Internet Explorer's XDomainRequest in Firefox or any of the other browsers? I'd like to access a service/website outside of my domain. 回答1: The XDomainRequest object in Internet Explorer 8 is a proprietary method for requesting resources which are outside the "same-origin policy." Firefox 3.5+ and Safari 4+ allow cross-domain requests through the XMLHTTPRequest object. User agents that support XMLHTTPRequest Level 2 must have Cross-Origin Resource Sharing support

cross-origin header in IE8/IE9

孤街浪徒 提交于 2019-12-03 11:17:34
问题 Since jQuery ajax ist not working for CORS/IE, I'm using XDomainRequest to retreive data from another Server. Work's fine, but I would like to send some header ('Authentification', 'content-type'). Is there a chance to add/change header in XDomainRequest? Or does someone know a workaround? 回答1: This is what we did for IE. If you have control over the target domain, host a (static) html file there. Include the html using the iframe. Now this iframe does actually have access to the local domain

Cross origin request blocked

喜欢而已 提交于 2019-12-02 00:48:42
问题 I want to retrieve json data from an other website so I tried to do a simple crossdomain request. I ran this index.php file on Wamp : <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" manifest="manifest.appcache"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>MySite</title> <script type="text/javascript"> function getXDomainRequest() { var xdr = null; if

Cross origin request blocked

时光总嘲笑我的痴心妄想 提交于 2019-12-01 21:00:53
I want to retrieve json data from an other website so I tried to do a simple crossdomain request. I ran this index.php file on Wamp : <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" manifest="manifest.appcache"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>MySite</title> <script type="text/javascript"> function getXDomainRequest() { var xdr = null; if (window.XDomainRequest) { xdr = new XDomainRequest(); } else if (window.XMLHttpRequest) { xdr = new

XDomainRequest aborts POST on IE 9

末鹿安然 提交于 2019-11-30 14:43:15
I am doing a cross domain Ajax call. My Code: if (window.XDomainRequest) // Check whether the browser supports XDR. { xdr = new XDomainRequest(); // Create a new XDR object. if (xdr) { xdr.timeout = 3000;//Set the timeout time to 3 second. xdr.onload = function () { alert("Success"); }; xdr.onerror = function () { alert("Error"); }; xdr.ontimeout = function () { alert("Error"); }; xdr.open("post", urlSearch); xdr.send(); } } else { $.ajax({ url: urlSearch, type: 'POST', dataType: 'json', timeout: 3000, success: function (data) { alert("Success"); }, error: function () { alert("Error"); } }); }

Access is denied error on XDomainRequest

那年仲夏 提交于 2019-11-30 08:08:31
I'm trying to use microsoft XDomainRequest to send cross domain request. Here is the code ... if ($.browser.msie && window.XDomainRequest) { // Use Microsoft XDR var xdr = new XDomainRequest(); xdr.open("POST", "http://graph.facebook.com/1524623057/"); xdr.send(); } .... It gives SCRIPT5: Access is denied. error on xdr.open(...) line. narek.gevorgyan I found the reason of this problem. As stated in Point 7 : Requests must be targeted to the same scheme as the hosting page This restriction means that if your AJAX page is at http://example.com , then your target URL must also begin with HTTP .

Access is denied error on XDomainRequest

痴心易碎 提交于 2019-11-29 10:43:32
问题 I'm trying to use microsoft XDomainRequest to send cross domain request. Here is the code ... if ($.browser.msie && window.XDomainRequest) { // Use Microsoft XDR var xdr = new XDomainRequest(); xdr.open("POST", "http://graph.facebook.com/1524623057/"); xdr.send(); } .... It gives SCRIPT5: Access is denied. error on xdr.open(...) line. 回答1: I found the reason of this problem. As stated in Point 7: Requests must be targeted to the same scheme as the hosting page This restriction means that if