Firefox setting to enable cross domain Ajax request

后端 未结 11 827
广开言路
广开言路 2020-11-28 06:46

I need to temporally allow cross domain XMLHttpRequest. Changing firefox security setting seems to be the way to go. But I\'ve tried with this and this but they did

相关标签:
11条回答
  • 2020-11-28 06:59

    What about using something like mod_proxy? Then it looks to your browser like the requests are going to the same server, but they're really being forwarded to another server.

    0 讨论(0)
  • 2020-11-28 07:03

    I used Fiddler as a proxy. Fiddler redirects localhost calls to a external server.

    I configured Firefox to use manual proxy (127.0.0.1 port 8888). Fiddler capture the calls and redirect them to another server, by using URL filters.

    0 讨论(0)
  • 2020-11-28 07:05

    Have you tried using jQuery's ajax request? As of version 1.3 jQuery supports certain types of cross domain ajax requests.

    Quoting from the reference above:

    Note: All remote (not on the same domain) requests should be specified as GET when 'script' or 'jsonp' is the dataType (because it loads script using a DOM script tag). Ajax options that require an XMLHttpRequest object are not available for these requests. The complete and success functions are called on completion, but do not receive an XHR object; the beforeSend and dataFilter functions are not called.

    As of jQuery 1.2, you can load JSON data located on another domain if you specify a JSONP callback, which can be done like so: "myurl?callback=?". jQuery automatically replaces the ? with the correct method name to call, calling your specified callback. Or, if you set the dataType to "jsonp" a callback will be automatically added to your Ajax request.

    0 讨论(0)
  • 2020-11-28 07:05

    I've tried using that 'UniversalBrowswerRead' thing too and it didn't work. You might be able to add an 'allow' header, but I haven't actually tried doing it yet. It's pretty new.

    You can find more information here

    0 讨论(0)
  • 2020-11-28 07:05

    To allow cross domain:

    1. enter about:config
    2. accept to be careful
    3. enter security.fileuri.strict_origin_policy in the search bar
    4. change to false

    You can now close the tab. Normally you can now make cross domain request with this config.

    See here for more details.

    0 讨论(0)
  • 2020-11-28 07:10

    You can check out my add on for firefox. It allows to cross domain in the lastest firefox version: https://addons.mozilla.org/en-US/firefox/addon/cross-domain-cors/

    0 讨论(0)
提交回复
热议问题