jQuery $.ajax(), $.post sending “OPTIONS” as REQUEST_METHOD in Firefox

前端 未结 23 2763
傲寒
傲寒 2020-11-22 14:38

Having trouble with what I thought was a relatively simple jQuery plugin...

The plugin should fetch data from a php script via ajax to add options to a

23条回答
  •  谎友^
    谎友^ (楼主)
    2020-11-22 15:17

    I used a proxy url to solve a similar problem when I want to post data to my apache solr hosted in another server. (This may not be the perfect answer but it solves my problem.)

    Follow this URL: Using Mode-Rewrite for proxying, I add this line to my httpd.conf:

     RewriteRule ^solr/(.*)$ http://ip:8983/solr$1 [P]
    

    Therefore, I can just post data to /solr instead of posting data to http://ip:8983/solr/*. Then it will be posting data in the same origin.

提交回复
热议问题