blockquote不会返回任何内容

问题描述 投票:0回答:1

这个sample在codepen中工作,但在我的html文件中不起作用?为什么会这样?

我已经尝试将https://添加到href,但仍然无法正常工作

<script async src="//s.imgur.com/min/embed.js" charset="utf-8"></script>
a
<blockquote class="imgur-embed-pub" lang="en" data-id="KUteCdn">
  <a href="//imgur.com/KUteCdn">View post on imgur.com</a>
</blockquote>
html imgur
1个回答
0
投票

我的猜测是这是一个与CORS相关的问题,通过检查你的js控制台来验证这一点。要解决此问题,您可以运行一个简单的HTTP服务器并从那里提供html文件。

在Mac OS上,您可以在工作目录的终端中运行以下命令

http-server -p 4090 .

在Web浏览器中,导航到http://localhost:4090

这将阻止您收到此类错误

© www.soinside.com 2019 - 2024. All rights reserved.