docsify不用服务器如何解决跨域问题?
html
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width,initial-scale=1">
<meta charset="UTF-8">
<link rel="stylesheet" href="http://unpkg.com/docsify/themes/vue.css">
</head>
<body>
<div id="app"></div>
<script>
window.$docsify = {
homepage: '../README.md',
el: '#app',
maxLevel: 3
}
</script>
<script src="http://unpkg.com/docsify/lib/docsify.min.js"></script>
</body>
</html>
错误信息
docsify.min.js:1 Access to XMLHttpRequest at 'file:///D:/***/README.md' from origin 'null' has been blocked by CORS policy: Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https.
F @ docsify.min.js:1
qe @ docsify.min.js:1
ze._fetch @ docsify.min.js:1
ze.$fetch @ docsify.min.js:1
(anonymous) @ docsify.min.js:1
He._init @ docsify.min.js:1
je @ docsify.min.js:1
(anonymous) @ docsify.min.js:1
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论