How to load a page in javascript?

  • ljCharlie
  • Proficient
  • Proficient
  • ljCharlie
  • Posts: 343

Post 3+ Months Ago

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
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • rtm223
  • Mastermind
  • Mastermind
  • User avatar
  • Posts: 1855
  • Loc: Uk

Post 3+ Months Ago

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:
  • RichB
  • Guru
  • Guru
  • User avatar
  • Posts: 1121
  • Loc: Boston

Post 3+ Months Ago

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>
  • ljCharlie
  • Proficient
  • Proficient
  • ljCharlie
  • Posts: 343

Post 3+ Months Ago

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 92 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
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.