0

I have a list of states in a drop down menu (select). I have a page for each state. Each page has the state abbreviation as a name, for example: Alabama is al.htm. I want to load the contents of htm depending on the selection of the state name; and the same for each state. In other words, if I select New York, I should see the information in ny.htm.

To load the data that is in different pages?

1
  • Where did you want this data to load? You could you some sort of iframe to display that specific page. Commented Apr 23, 2012 at 15:06

1 Answer 1

1

Your question is quite vague, so this answer makes a few assumptions. Firstly, I'm assuming the value of each option is the abbreviation e.g.:

<select id="yourSelect">
    <option value="al">Alabama</option>
</select>

Next, I'm assuming you want to load the content of the pages into a specific element on your page, and that you want this to happen any time the selection changes:

$("#yourSelect").change(function() {
    $("#whereToLoad").load(this.value + ".htm");
});
Sign up to request clarification or add additional context in comments.

2 Comments

If I have a map and I create an image map, how can I display the same page by clicking on the state in the map?
I'm not sure what you mean. It sounds like you have a completely different question so you should probably post a new question asking it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.