How to load a page in javascript?

  • ljCharlie
  • Proficient
  • Proficient
  • No Avatar
  • Joined: May 15, 2003
  • Posts: 343
  • Status: Offline

Post June 11th, 2004, 9:01 am

I have a drop down box for user to select which page they want to look at. Will anyone show me how to load a page in javascript once a user select a particle option in the select drop down box?

Many thanks for the help.

ljCharlie
  • Anonymous
  • Bot
  • No Avatar
  • Joined: 25 Feb 2008
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post June 11th, 2004, 9:01 am

  • rtm223
  • Mastermind
  • Mastermind
  • User avatar
  • Joined: Mar 24, 2004
  • Posts: 1855
  • Loc: Uk
  • Status: Offline

Post June 11th, 2004, 9:08 am

would this thread be useful, as it's basically the same question but changing image locations instead of window src's?

http://www.ozzu.com/website-design-forum/load-picture-choosing-from-dropdown-list-t826.html

:wink:
CSS website design tutorials
  • RichB
  • Guru
  • Guru
  • User avatar
  • Joined: May 17, 2003
  • Posts: 1121
  • Loc: Boston
  • Status: Offline

Post June 11th, 2004, 9:09 am

This is an example of one:

Code: [ Select ]
<html>
<head>
<title>Untitled</title>
<script type="text/javascript">
<!--
function nav(f){
  var theUrl = f.jump.options[f.jump.selectedIndex].value ;
  if (theUrl != ""){
      location.href = theUrl ;
  }
}
//-->
</script>
</head>
<body>
<form action="no_value">
<select name="jump" onchange="nav(this.form)">
<option value="">----- Select A Page -----</option>
<option value="index.html">Home</option>
<option value="page2.html">Page 2</option>
<option value="page3.html">Page 3</option>
</select>
</form>
</body>
</html>
  1. <html>
  2. <head>
  3. <title>Untitled</title>
  4. <script type="text/javascript">
  5. <!--
  6. function nav(f){
  7.   var theUrl = f.jump.options[f.jump.selectedIndex].value ;
  8.   if (theUrl != ""){
  9.       location.href = theUrl ;
  10.   }
  11. }
  12. //-->
  13. </script>
  14. </head>
  15. <body>
  16. <form action="no_value">
  17. <select name="jump" onchange="nav(this.form)">
  18. <option value="">----- Select A Page -----</option>
  19. <option value="index.html">Home</option>
  20. <option value="page2.html">Page 2</option>
  21. <option value="page3.html">Page 3</option>
  22. </select>
  23. </form>
  24. </body>
  25. </html>
Free Programming Resources
  • ljCharlie
  • Proficient
  • Proficient
  • No Avatar
  • Joined: May 15, 2003
  • Posts: 343
  • Status: Offline

Post June 11th, 2004, 11:25 am

Thank you very very much! It's working now.

ljCharlie

Post Information

  • Total Posts in this topic: 4 posts
  • Users browsing this forum: No registered users and 106 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 2011 Unmelted, LLC. Ozzu® is a registered trademark of Unmelted, LLC.