I K I K - 3 months ago 5
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?
Cheers.

I K I K
Answer

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

document.location.href

This seems to work fine without any issues.