简体   繁体   中英

iframe - opening unintended page in IE

I have an Iframe like this:

<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.

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. And if the user successfully logs in then the website returns a list of products which will be shown in the 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. IE always shows only the login page. But when I open the same URL in a new window in IE, it works fine. How can I solve this?

Please keep in mind i am using https.

try this

It clashes less with the same origin security issue which prohibits you to interact with the framae/window using its attributes

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


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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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