Solved

Jump to anchor with JS

Posted on 1997-08-25
1
810 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

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Having worked on larger scale sites, we found out that you are bound to look at more scalable solutions to integrating widgets, code snippets or complete applications and mesh them into functional sites, in any given composition. To share some of…
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
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…

809 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