Solved

document.location

Posted on 2001-06-17
5
700 Views
Last Modified: 2012-06-21
hi,
HOw can i use the document.location=xxx.htm comand to point to a certain section of page xxx?

i know there's a way involving # and <a name> but imnot sure exactly how so if you know, or if there's another way of doing so, the 40 points are your's...
thanks
0
Comment
Question by:Majorem
  • 3
  • 2
5 Comments
 
LVL 33

Accepted Solution

by:
hongjun earned 40 total points
ID: 6199957
Try this.

document.location.href = "your_url.htm#your_name";

hongjun
0
 
LVL 33

Expert Comment

by:hongjun
ID: 6199963
Below is using javascript.

<html>
<head>
</head>
<body>
<a name="your_name1">First Anchor Name</a>
This is your first anchor name
...
<a name="your_name2">Second Anchor Name</a>
...
<a style="cursor: hand" onClick="document.location.href='your_url.htm#your_name1'">Go to first bookmark</a>
<br>
<a style="cursor: hand" onClick="document.location.href='your_url.htm#your_name2'">Go to second bookmark</a>
</body>
</html>

hongjun
0
 

Expert Comment

by:hjainu
ID: 6199964
location.href="url#abc"
abc or any other thet you want to refer to

(# is the internal link anchor name)
0
 
LVL 33

Expert Comment

by:hongjun
ID: 6199965
Below is using html only.

<html>
<head>
</head>
<body>
<a name="your_name1">First Anchor Name</a>
This is your first anchor name
...
<a name="your_name2">Second Anchor Name</a>
...
<a href="your_url.htm#your_name1">Go to first bookmark</a>
<br>
<a href="your_url.htm#your_name2">Go to second bookmark</a>
</body>
</html>

hongjun
0
 

Expert Comment

by:hjainu
ID: 6199968
Hongjun has the right answer
0

Featured Post

Active Directory Webinar

We all know we need to protect and secure our privileges, but where to start? Join Experts Exchange and ManageEngine on Tuesday, April 11, 2017 10:00 AM PDT to learn how to track and secure privileged users in Active Directory.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Make options hidden and show just option that is on 1 29
Create an automated page index 9 53
VBScript on Html 15 48
How to filter by key press ? 6 25
This article shows how to create and access 2-dimensional arrays in JavaScript.  It includes a tutorial in case you are just trying to "get your head wrapped around" the concept and we'll also look at some useful tips for more advanced programmers. …
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
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…

830 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