PacersForever
New Member
- Messages
- 21
- Reaction score
- 0
- Points
- 0
Is it possible to have buttons that change the iframe on your site ? Diagram below.
<a href="http://forums.x10hosting.com/programming-help/url">
<a href="http://forums.x10hosting.com/programming-help/url" target="name">
<a href="http://www.google.com" target="frame">Google in frame.</a>
<iframe name="frame" />
Firefox doesn't know how to open this address, because the protocol (htt) isn't associated with any program.
JS is good for this. However, make sure you use the following to ensure that it will work for more people:Or you could JS it.
HTML:<button onclick="document.getElementById('frame').src = 'http://www.google.com';">Google.com</button> <iframe id='frame' />
<script type='text/javascript>
document.write ("<button onclick=\"document.getElementById('frame').src = 'http://www.google.com';\">Google.com</button>");
</script>
<noscript>
<a href="http://www.google.com" target="frame">Google in frame.</a>
</noscript>
<iframe name='frame' id='frame'>
<a href="http://www.nba.com" target="frame">NBA</a>
</noscript>
<a href="http://www.google.com" target="frame">Google in frame.</a>
</noscript>
</p>
<script type='text/javascript>
document.write ("<button onclick=\"document.getElementById('frame').src = 'http://www.google.com';\">Google.com</button>");
</script>
<noscript>
<a href="http://www.google.com" target="frame">Google in frame.</a>
</noscript>
<iframe name='frame' id='frame'>
I'm not quite sure what you mean there...?Is there a way to make the links buttons and for it to automatically open in one of the links ?
<p>
<script type='text/javascript'>
document.write ("<button onclick=\"document.getElementById('frame').src = 'http://www.google.com';\">Google</button>");
document.write ("<button onclick=\"document.getElementById('frame').src = 'http://www.nba.com';\">NBA</button>");
</script>
<noscript>
<a href="http://www.google.com" target="frame">Google</a> <a href="http://www.nba.com" target="frame">NBA</a>
<button onclick="document.getElementById('frame').src = 'http://www.google.com';">Google</button>
</noscript>
</p>
<iframe name='frame' id='frame' width='600' height='500'></iframe>