Create an address bar to direct an iframe?
Well, I'm trying to dart back and forth around the internet, in a fashion
similar to this: http://jsfiddle.net/Muimi/gm7gv/. Unfortunately, my code
doesn't work. What is happening is that the page isn't redirecting at all.
I noticed that it gave me errors like 'page does not exist', for
google.com (which exists, just so everyone knows). So, any ideas?
<!DOCTYPE html>
<html>
<head>
<style>
#showUrl {
border:2px solid #0A9;
height:90%;
width:95%;
}
#url {
width:30em;
}
</style>
<script type="text/javascript">
function loadUrl() {
var url = document.getElementById( 'url' ).value;
var showUrl = document.getElementById( 'showUrl' );
showUrl.src = url;
}
</script>
</head>
<body>
<form>
Enter URL to load: <input type="text" id="url" />
<input type="button" value="Load URL" onclick="loadUrl()" />
</form>
<iframe id="showUrl"></iframe>
</body>
</html>
No comments:
Post a Comment