[英]IFRAME not loading in parent frame when called from HTML page
We have 1 IFRAME present in asp page. ASP页面中有1个IFRAME。 And 1 HTML page where we have redirected to the parent IFRAME on click of anchor tag using angular.js.
还有1个HTML页面,在该页面上,我们使用angular.js单击了锚标记,从而将其重定向到父IFRAME。
In HTML page we have code as given below present inside anchor tag, 在HTML页面中,锚标签中包含以下代码,
ng-click="seeDetail(); ">
Go to parent Iframe ng-click="seeDetail(); ">
转到父级iframe
In javascript function seeDetail()
we have code as shown below, 在javascript函数
seeDetail()
我们具有如下所示的代码,
var url = "./PageToBeLoaded.asp";
parent.document.getElementsByTagName("IFRAME").item("frameID").src = url;
On call of this statement in javascript we need the URL to launch in parent IFRAME.However instead of loading in the parent IFRAME its loading in the HTML page itself. 在javascript中调用此语句时,我们需要在父IFRAME中启动URL。但是,与其在父IFRAME中加载而不是在HTML页面本身中加载。
Yes it is. 是的。 You're looking in the parent, finding the iframe, and setting the
src
of it, which is probably the current iframe. 您正在寻找父项,找到iframe,并设置其
src
,这可能是当前的iframe。 I think what you're looking for is parent.location.assign(url)
. 我认为您正在寻找的是
parent.location.assign(url)
。
We used ng-href tag with target attribute and it worked fine. 我们将ng-href标记与target属性一起使用,效果很好。 Provided the URL to the ng-href and the frame name to the target attribute.
提供ng-href的URL以及目标属性的帧名。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.