View Single Post
  #4 (permalink)  
Old 02-11-08, 04:52 PM
ftvids ftvids is offline
Newbie Coder
 
Join Date: Oct 2007
Location: London, UK
Posts: 22
Thanks: 0
Thanked 0 Times in 0 Posts
Exclamation

I've been trying to implement what you suggested, Vicious... but I can't seem to get it to work

Here's what I've got:

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

function getSrc(obj) {
	alert(obj.src);
	return obj.src;
}
//-->
// above is the code to get the url from your frame

// now we place that url into the input box:
document.getElementById("frameid").value = myframe; // with frameURL defined earlier 
</script>
</head>
<body>
<p><b>|</b> 
<a href="#" onclick="javascript:getSrc(document.getElementById('myframe'))">Get src</a> - displays with alert</p>

<iframe id="myframe" src="http://www.google.com"></iframe>
<br>
<br>
<input Id="frameid"><p>frameurl not showing in input</p>
</body>
</html>
Thanks,
ftvids
Reply With Quote