Go to bookmark on page load

A

AsherMaximum

I'm not sure if this should be done with html or javascript, but i need
to go to a bookmark in a page when the page loads.
The code must be in the same page as the bookmark, as the page where
the bookmark is is rendered through php.

Thanks for the help
 
N

Neredbojias

To further the education of mankind, "AsherMaximum"
I'm not sure if this should be done with html or javascript, but i need
to go to a bookmark in a page when the page loads.
The code must be in the same page as the bookmark, as the page where
the bookmark is is rendered through php.

Thanks for the help

This is accomplished with the use of the hash (#) mark. Search for hash +
bookmark.
 
T

The One

I'm not sure if this should be done with html or javascript, but i need
to go to a bookmark in a page when the page loads.
suffix #<bookmark name>

create bookmarks by using the A tag
<a name="MyFirstBookmark"></a>
this will create a bookmark on the page apple.html

to go to that bookmark automatically when the page loads, the link should
look like this
http://www.mydomain.com/apple.html#MyFirstBookmark
 
A

Andy Dingley

The said:
create bookmarks by using the A tag
<a name="MyFirstBookmark"></a>

Use the id attribute instead of the name attribute. This can be applied
to any element, not just <a>. It's just a "more modern" way of working,
rather than <a name="" > being deprecated or wrong, but it's still
worth doing. It works everywhere that matters.

Also <a name="foo" ></a> isn't advised - Use <a name="foo>some text</a>
instead.
This complies with the spec and there have been browsers (Opera) that
didn't like the no-text version.


NB - The hash "#" character goes where you _use_ the bookmark, but
isn't in the bookmark itself (simple, but confuses a lot of people).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top