Solved

document.location

Posted on 2001-06-17
5
701 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

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

Avoid defining the variables in the global scope; trying to define them in a local function scope. Because:   • Look-up is performed every time a variable is accessed.   • Variables are resolved backwards from most specific to least specific scope…
This article discusses how to implement server side field validation and display customized error messages to the client.
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…

734 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