I K I K - 1 year ago 72
HTML Question

Getting the iframe's URL parameter from within the iframe

I have an iframe that is loaded on web page and I do not have permissions to access the parent page. I have access to the iframe's code. I would like to access one of the parameters of this iframe. What is the best way to achieve this?

I tried location.search but it does not give me all the parameters.

Any suggestions?

Answer Source

I managed to find the answer myself and we can retrieve the iframe's URL using the following code:


This seems to work fine without any issues.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download