1. 程式人生 > >解決 js ajax跨域訪問報“No 'Access-Control-Allow-Origin' header is present on the requested resource.”錯誤

解決 js ajax跨域訪問報“No 'Access-Control-Allow-Origin' header is present on the requested resource.”錯誤

訪問 con tails request pre ade ont details -a

參考頁面:https://blog.csdn.net/idomyway/article/details/79572973

如果請求的是PHP頁面:

header("Access-Control-Allow-Origin: *");

解決 js ajax跨域訪問報“No 'Access-Control-Allow-Origin' header is present on the requested resource.”錯誤