 
                        如题,代码如下:
const URL = 'http://api.xx.com/?q='
let req = URL + word
fetch(req)
    .then(res => res.json())
    .then(res => console.log(res)
    .catch(err => console.log(err)在本地调试的时候,由于跨域不能访问,请问跨域的情况下该如何使用fetch
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
你的
http://api.xx.com/?q=返回header里有正确设置Access-Control-Allow-Origin吗?