Javascript 权限被拒绝iframe位置href

Javascript 权限被拒绝iframe位置href,javascript,windows-store-apps,Javascript,Windows Store Apps,请告诉我如何修复此错误: 我需要找到当前在iframe中的URL JS: html: 您正在尝试获取iframe的url吗?这是由于同源策略,该策略可防止恶意软件(或您的脚本)从加载到不同域的页面读取数据。 $("h1").text($("#showLogin").get(0).contentWindow.location.href); <iframe id="showLogin" src="https://oauth.vk.com/authorize?...."></ifr

请告诉我如何修复此错误:

我需要找到当前在iframe中的URL

JS:

html:


您正在尝试获取iframe的url吗?这是由于同源策略,该策略可防止恶意软件(或您的脚本)从加载到不同域的页面读取数据。
$("h1").text($("#showLogin").get(0).contentWindow.location.href);
<iframe id="showLogin" src="https://oauth.vk.com/authorize?...."></iframe>
JavaScript runtime error: Permission denied