简体   繁体   English

iframe-在IE中打开意外页面

[英]iframe - opening unintended page in IE

I have an Iframe like this: 我有一个这样的iframe:

<iframe src="http://microsoft.com"></iframe>

My script goes like this: 我的脚本是这样的:

<script>
    for (var i = 0; i < frames.length; i++) {
        frames[i].location = "https://www.domain.com?parameter";
    }
</script>

Problem: The above code works fine in Firefox or any other browser but IE. 问题:上面的代码在Firefox或除IE之外的任何其他浏览器中都能正常工作。

Actually the problem is that when the page is loaded the src of the iframe is changed using the script, and this src goes to the another domain and login. 实际上,问题是在加载页面时,使用脚本更改了iframe的src,并且该src转到了另一个域并登录。 And if the user successfully logs in then the website returns a list of products which will be shown in the iframe. 如果用户成功登录,则网站将返回一个产品列表,该列表将显示在iframe中。 When I run in Firefox, passing the parameter for the src, the user successfully authenticates in the website and the list of products is shown, but this does not happen in IE. 当我在Firefox中运行时,传递src的参数时,用户会在网站上成功进行身份验证,并显示产品列表,但这在IE中不会发生。 IE always shows only the login page. IE始终只显示登录页面。 But when I open the same URL in a new window in IE, it works fine. 但是,当我在IE中的新窗口中打开相同的URL时,它工作正常。 How can I solve this? 我该如何解决?

Please keep in mind i am using https. 请记住,我正在使用https。

try this 尝试这个

It clashes less with the same origin security issue which prohibits you to interact with the framae/window using its attributes 与相同来源安全性问题的冲突较少,该问题禁止您使用其属性与framae /窗口进行交互

<iframe name="frame1" src="http://microsoft.com"></iframe>


 window.open("https://www.domain.com?parametr","frame1");

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM