Ajax call to PHP is returning nothing

后端 未结 1 1716
逝去的感伤
逝去的感伤 2020-12-21 03:56

I\'m trying to make my first ajax example working on my MAMP. my ajax.html looks like:





        
1条回答
  •  暖寄归人
    2020-12-21 04:44

    Your problem is that you're trying to do a cross domain request. The browser prevents it due to same origin policy.

    The standard solution is to set CORS headers in your PHP to allow those requests.

    For example :

    
    

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