If I have a button within a iframe, how can I create a pop-up window that will appear as part of the parent window and not within the iframe window, when I press on this button, within the iframe?
Not sure that you can, this is a protection from iframes taking over a parent page. Meaning you couldn't have a floating div. You could popup a new window from the browser like normal.
Related
I have a page that is opened in iframe, that page has a modal/popup in it. I want to access the parent page (opened in iframe) values, in modal using jquery or javascript. any ideas how could I do that?
I have tried it using window.parent.document but it takes me to the index page, while I want to remain inside the body of page opened in iframe. And window.parent.$('#someId:checked') gives me [prevObject: r.fn.init(1)].
I have a page with a link with opening attribute '_blank'. But when click the link and open a new window, there are scripts in the new window, like 'window.opener.location' which changes the parent window's behaviors. However, this is not I wanted. How can I prevent this happening.
Thanks.
Simply put, how can I open a popup window INSIDE an iframe? Whether I use window.open in the parent window or the iframe, the popup window loads on top of the parent. Is it possible to open up a new window such that it's confined to the iframe?
Thank you very much for any help.
It is not possible to open a new window so that it is confined to the iframe. Functionality similar to what you're asking for could be achieved using a JavaScript lightbox.
On domain1.com I have a link that opens a popup to domain2.com. Within the popup is an iframe, also hosted on domain2.com. From within the iframe, i am trying to close the popup window. I seem to be getting confused on how to do this. From the iframe, do I call a javascript function defined in the popup that will close the window? Can I close the window directly from the iframe?
Using this: parent.window.close(); or this: top.window.close(); you should be able to close it.
Is there any way to make an iframe act as if it were part of the page. Such as when I click a link, it either will open the links in a new tab/window by default, or have it so that when a link is clicked, it will open in the same window, but not just the iframe?
You can just set the target attribute. To open in the current top window (top frame):
Link Text
Or to open in a new window:
Link Text
There's also _parent for the parent window (not necessarily the top) and _self for the current window (the default).
Do you have control of the content that is in the iframe?
You could use target=_top for the links.