Solved

Jump to anchor with JS

Posted on 1997-08-25
1
807 Views
Last Modified: 2008-03-10
I have a page consisting of 2 frames.  One is the "list" frame and the other is the ref "frame".
In the ref frame I have a select object set up so that when I change the select object it jumps the list frame document down to the corresponding section.
This code makes Internet Explorer do this but it relaods the list page each time.

  var a = "#" +
          theForm.ID.options[theForm.ID.selectedIndex].value
          + "anchor";
  parent.list.location=a;

This code brings the browser to the right spot but as I said, it reloads the page again.  The page is too large for this to be usefull.
I need an answer as soon as possible.
Thanks,
Pete
0
Comment
Question by:pmcintos
1 Comment
 
LVL 10

Accepted Solution

by:
kollegov earned 100 total points
ID: 1269166
That's because you make POST or GET action from
form submitting, you didn't post here full code
how you call this script!

but generally
you should call your function
so
<FORM onSubmit()='setNewLocation(); return false;'>

to avoid reloading.



0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

When you need to keep track of a simple list of numbers or strings, the Array object is your most direct tool.  As we saw in my earlier EE Article (http://www.experts-exchange.com/A_3488.html), typical array handling might look like this: (CODE) B…
Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now