Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6577887
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T15:41:52+00:00 2026-05-25T15:41:52+00:00

Following is the script that makes a jump menu.Using javascript i have set the

  • 0

Following is the script that makes a jump menu.Using javascript i have set the index of the options tag to be equal to 0.The scrip works fine except one.After i jump to another page from the jump menu the index is not reset to the index 0.Instead it is set to the index where i had clicked.Why is it so ? What is the problem with script ?

script:

window.onload = startInit;

function startInit() {
document.getElementById("newLocation").selectedIndex = 0;
document.getElementById("newLocation").onchange = jumpPage;
}

function jumpPage() {
var newLoc = document.getElementById("newLocation");
var newPage = newLoc.options[newLoc.selectedIndex].value;
if(newPage != "")
   window.location = newPage;
}

HTML

<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<script type="text/javascript" src="script.js">
</script>
</head>

<body bgcolor="#FFFFCC">
<center>
<form>
<select id="newLocation">
 <option value="myworld.gif">first</option>
 <option value="myhome.gif">second</option>
 <option value="myroom.gif">third</option>
 <option value="mybed.jpg">fourth</option>
</select>
</form>

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T15:41:52+00:00Added an answer on May 25, 2026 at 3:41 pm

    Browser acts smart and caches your page. So are seeing the cached version of your
    HTML page.To ensure that this doesn’t happen and you always start up with the
    0th index,tell the browser not to do anything (the way you want) when the page
    unloads.

    The statement should be:
    window.onunload = function(){}; // do nothing function

    you can add after window.onload = startInit;

    That tells the browser that something happened during unloading and therefore it
    should re-read the page.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following jQuery script that makes an orange transparent hover effect cover
I have the following script that works well in Firefox and Chrome (not sure
I have the following script that changes my image on a timer: var da
I have a PHP script that does the following: Uses file_get_contents() to get content
I have the following simple python test script that uses Suds to call a
I have a CGI script that prints the following on stdout: print Status: 302
I have written a KornShell (ksh) script that sets an array the following way:
I have a calc function in java script that takes three integer parameters, following
I was wondering if someone can help me, I have the following script that
I use Ubuntu and am trying to write a script that makes the following:

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.