suryaguruprakash suryaguruprakash - 1 year ago 114
Javascript Question

i want to get url from iframe

this is the code im using.............

i want to get current url(href) from below code ...............

<script type="text/javascript">
function load() {
var url = document.getElementById("iframeid");

//get the ifram onload url of href

<iframe onload="load()" name="Google" id="iframeid" scrolling="auto" style="width:95%;height:600px" src="" >


Answer Source

This will work only if they are in the same domain,protocol and port:


else use :

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