所以我用node.js(watch-http-server)创建了一个本地web服务器。当我跑下面时,它完全符合堆栈的片段。然而,问题是当我在我的本地WebJavascript安全错误
的SecurityError上运行它:权限被拒绝跨域对象
$(function(){
\t alert('load');
});
body, html{
\t padding: 0;
\t margin: 0;
\t cursor: default;
\t overflow: hidden;
\t background: url("../res/background.png") no-repeat;
\t background-size: cover;
}
.stream-container{
\t position: fixed;
\t margin: 0;
\t padding: 0;
\t top: 2%;
\t left: 5%;
}
.chat-container{
\t position: fixed;
\t margin: 0;
\t padding: 0;
\t
\t top: 33%;
\t left: 5%;
}
<!Doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title> Twitch Bot </title>
<meta name="author" content="Author">
\t <link rel="stylesheet" href="../css/styles.css">
</head>
<body>
<div class="stream-container">
\t <iframe id = "stream-frame" src="https://player.twitch.tv/?channel=dyarambo" height="300px" width="30px" frameborder="0" scrolling="no" allowfullscreen="false"></iframe>
</div>
<div class="chat-container">
<iframe frameborder="0" scrolling="no" id="chat_embed" src="https://www.twitch.tv/lovenpk/chat?darkpopout" height="300px" width="300px"></iframe>
</div>
\t
<!-- Javascripts below -->
<script src="https://code.jquery.com/jquery-3.2.0.min.js"></script>
<script type="text/javascript" scr="../js/index.js"></script>
</body>
</html>
任何想法上访问属性的“href”?