Click here to Skip to main content
15,885,366 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi
I have an iframe tag in my page
when iframe age load . it generate a query String
I want to read the page url with queryStrings
but it just show my iframe src !

JavaScript
function getiframeURL()
      {
          alert(document.getElementById('myframe').scr);
      }
Posted
Comments
Arkadeep De 19-Nov-14 4:42am    
you can get the iframe source only when the site in iframe and your master site both are in the same domain..other wise not...once I tried for this one,but didn't get the actual process to do this...

1 solution

w3schools:
Note: Because of security reasons, the contents of a document can be accessed from another document only if the two documents are located in the same domain.
If the containing page and the iframe/frame target belong to the same domain you can use this line:
JavaScript
alert(document.getElementById('myframe').documentWindow.location.href);
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900