View Single Post
  #5 (permalink)  
Old 02-12-08, 08:19 AM
Vicious's Avatar
Vicious Vicious is offline
Community VIP
 
Join Date: Jan 2007
Location: Belgium
Posts: 584
Thanks: 0
Thanked 0 Times in 0 Posts
I modified your code, and tested it in Firefox:

HTML Code:
<html>
<head>
<script type="text/javascript">
<!--
function setSrc(obj, url) {
	obj.src = url;
}

function getSrc() {
	var obj = document.getElementById('myframe');
	document.getElementById("frameid").value = obj.src;
	return false; // if we return false, then we don't go to the URL defined in the href (here #)
}
//-->
</script>
</head>
<body>
<p><b>|</b> 
<a href="#" onclick="return getSrc();">Get src</a> - displays with alert</p>

<iframe id="myframe" src="http://www.google.com"></iframe>
<br>
<br>
<input id="frameid" value="" name="frameid" /><p>frameurl not showing in input</p>
</body>
</html>
__________________
Jack Bauer makes Chuck Norris cry

Last edited by wirehopper; 07-21-09 at 04:02 PM. Reason: HTML tags
Reply With Quote