Solved

document.location

Posted on 2001-06-17
5
697 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
Comment Utility
Try this.

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

hongjun
0
 
LVL 33

Expert Comment

by:hongjun
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
Hongjun has the right answer
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

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…
This article discusses how to create an extensible mechanism for linked drop downs.
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…

771 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

13 Experts available now in Live!

Get 1:1 Help Now