Update iframe? |
Update iframe? |
Kewley |
Oct 10 2006, 05:46 PM
Post
#1
|
Group: Members Posts: 2 Joined: 10-October 06 Member No.: 397 |
IFRAME SRC="" width=772 height=630 name="worldframe" frameborder="0" scrolling="no">
</IFRAME> How would I go about updating the iframe once an option has been selected from a drop down list? For instance when the user selects an option from a drop down list, the iframe updates to show the a page. However, if the user clicks a different option the iframe updates with to show a different page? Any help is greatly appreciate, thanks. EDIT: I tryed using the following, but to no avail..... CODE <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Untitled Document</title> <script type="text/javascript"> function update(page) { document.getElementById('worldnumber').location.href=page; } </script> </head> <body> <select id="sel" onchange="update(this.value)"> <option value="http://ams2.runescape.com/lang/en/aff/runescape/game.ws?lowmem=1&plugin=0">1</option> <option value="http://mi6.runescape.com/lang/en/aff/runescape/game.ws?lowmem=1&plugin=0">2</option> <option value="http://ul5.runescape.com/lang/en/aff/runescape/game.ws?lowmem=1&plugin=0">3</option> </select> <center> <IFRAME SRC="" NAME="worldnumber" WIDTH=300 HEIGHT=200> </IFRAME> </center> </body> </html> |
pandy |
Oct 10 2006, 06:21 PM
Post
#2
|
🌟Computer says no🌟 Group: WDG Moderators Posts: 20,716 Joined: 9-August 06 Member No.: 6 |
You use getElementById() but there is no id. Even if you add one it doesn't work. I'm afraid I don't know why. If you refer to the frame name instead it works.
window.worldnumber.location.href=page; |
Lo-Fi Version | Time is now: 29th March 2024 - 08:37 AM |