PDA

View Full Version : URL of Ifame that is generated by script



chadactive
02-19-2008, 11:18 PM
Hello everyone, I need a little help...

Iframe is generated on my page by a script like this...


<script src="http://example.com/make_iframe"></script>

How can I get the URL/SRC of the generated iframe?

Master_script_maker
02-19-2008, 11:52 PM
<script type="text/javascript">
var src=document.getElementById("iframeID").src;
</script>

jackbenimble4
02-20-2008, 12:02 AM
We'd need to see the script. To get the urls of all the iframes on the page you could do something like this:



var iframes = document.getElementsByTagName("iframe");
for(var i = 0; i < iframes.length; i++) {
alert(iframes[i].src);
}