Javascript Can';t检索window.location.href
我有以下代码,试图检索新打开窗口的urlJavascript Can';t检索window.location.href,javascript,location-href,Javascript,Location Href,我有以下代码,试图检索新打开窗口的url <script type="text/javascript"> this.windowRef = window.open("http://www.google.com"); console.log(this.windowRef.location.href); </script> this.windowRef=window.open(“http://www.google.com"); console.log(this.windo
<script type="text/javascript">
this.windowRef = window.open("http://www.google.com");
console.log(this.windowRef.location.href);
</script>
this.windowRef=window.open(“http://www.google.com");
console.log(this.windowRef.location.href);
然而,当我看到浏览器的控制台时,显示的结果是:“about:blank”,而不是“www.google.com”
为什么呢?如何显示www.google.com
感谢您的帮助。阻止您从其他域读取数据