javascript能调用外部api吗

类似这样:fetch(‘xx/api/xx’).then(res => res.json()).then(console.log)

调用外部 API 需要使用 Python 脚本。JS 经常会有跨域的问题。