2

I'm currently writing a script which is purposefully leaving out jquery as a dependency.

So with Native JS I am making a CORS request to a server. However, I can't control the protocol of the browser. Some may be http:, some may be https:. The server I post to will always be https: How do I with the native XDomainRequest object in IE 8 and 9 allow posting to these even if the location.protocol is different than the requested domains protocol?

sideshowbarker
  • 81,827
  • 26
  • 193
  • 197
Blaine Kasten
  • 1,633
  • 1
  • 15
  • 27
  • XDomainRequest can't do this. You could use a form post instead. – monsur Feb 13 '14 at 19:01
  • Unfortunately that won't work for the setup I'm doing. The script I'm writing will be injected on many different pages, which I have no control over. How does jQuery AJAX make CORS requests in old browsers? There has to be a way. – Blaine Kasten Feb 13 '14 at 19:21
  • You could also use JSON-P. This is what "crossdomain" means to JQUery before CORS arrived. – monsur Feb 13 '14 at 20:28

0 Answers0