【发布时间】:2020-08-25 23:13:34
【问题描述】:
要查看问题,请输入此 URL“https://gainesrad.com/readqrcodefromkiosk/”
它应该显示网页的 URL,但我得到的是“about:srcdoc”。
这是 gainesrad.com/readqrcodefromkiosk 上的 HTML 代码
<!DOCTYPE html>
<html>
<body>
<b>This should tell me the URL of the page but instead is says "about:srcdoc"</b>
<p id="demo"></p>
<script>
document.getElementById("demo").innerHTML = "The full URL is: " + window.location.href;
</script>
</body>
</html>
【问题讨论】:
-
在同一个域中尝试
top.location.href
标签: javascript html url