I want to open a remote url inside a javascript popup instead of doing window.open(). I came across libraries like lytebox,lightbox,thickbox which do that if the popup is opened from main webpage. However my requirement is to open the popup from the link which occurs in a small iframe within the main page.( I can not alter the code of the main page, however Iframe webpage is fully in my control) When I include those libraries in my iframe webpage, it opens the popup, but restricted only to within iframe.How to make it appear over whole browser window ? This is what i want : The user clicks on "click here" and it opens a javascript layer,not restricted to within iframe.

enter image description here

1

There are 1 best solutions below

0
On BEST ANSWER

you can just use

parent.document 

from the iframe to access the parent window, if it is from the same domain. Otherwise, security concerns are raised.

You can inject the javascript by creating a script element in the parent's document, and then will be able to access the necessary functions.