gpt4 book ai didi

javascript - 错误 : Can't access property href

转载 作者:行者123 更新时间:2023-11-30 13:05:57 26 4
gpt4 key购买 nike

<分区>

我正在使用 NODE JS 模块创建 HTTP 服务器。服务器的响应是一个包含 JavaScript 的页面,它在 .这是响应代码:

<html>
<head>
<script type='text/javascript'>
function test() {
document.body.innerHTML='<iframe id="ifool" src="URL" sandbox="allow-same-origin allow-forms allow-scripts"> </iframe>';
var c;
window.setInterval(function(){
c=document.getElementById("ifool").contentWindow.location.href;
window.history.pushState(0,0,c);
},100);
</script>
</head>
<body onload= "test()">
</body>
</html>

我在 FF 中使用 Firebug。我收到以下错误:

 Error: Permission denied to access property 'href'
c=document.getElementById("ifool").contentWindow.location.href;

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com