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

前端 未结 23 2771
傲寒
傲寒 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:34

    You need to do some work on server side. I see you are using PHP on server side, but solution for .NET web application is here: Cannot set content-type to 'application/json' in jQuery.ajax

    Do the same in PHP script and it will work. Simply: At first request browser is asking server if is allowed to send such data with such type and second request is the proper/allowed.

提交回复
热议问题