PDA

View Full Version : using numbers like anchors


elson
01-23-2003, 03:45 AM
Hello,

Is there a way to use numbers in a page, like anchors, and find it using javascript, without using tags?
ex.:

1
lskjdlkjlkjlj

2
erpprysks-iwerrpotprioiproip

3
ēsldēsdireesēkjfldj


It is for an internal page "jumping" navigation idea.

joh6nn
01-23-2003, 05:47 AM
you probably could, but it would be way more work than just using anchors.

elson
01-23-2003, 01:52 PM
Well, i don't believe...

If i can navigate jumping between pages (1.htm, 2.htm,...) by sequencial numbers as names, using next and prev, ...why not do the same inside a page?

If i can find and highlight all occurrences of a number in a page in a search query, ...why not find sequencial numbers?

I,m thinking about the possibility of navigate by numbers (1) inside a page with sequencial numbers (2) in a simple script (3)

I,m a "rookie" in javascript, but i try the hard way...

Borgtex
01-23-2003, 04:41 PM
Originally posted by elson
If i can navigate jumping between pages (1.htm, 2.htm,...) by sequencial numbers as names, using next and prev, ...why not do the same inside a page?

Yes well but... that's exactly what anchors are for. Very simplified:

Internet>Web site>pages>anchors

or to say in another way, anchors are for a page the same that pages are for a web site. Sorry if that doesn't helps, but I don't really see the point in linking to numbers

whammy
01-23-2003, 09:20 PM
how about using anchors with numbers?

<a name="1" />

<a name="2" />

<a href="#1">1</a>
<a href="#2">2</a>

ConfusedOfLife
01-23-2003, 10:05 PM
I want to 2nd Borgtex and say why you wana make something that's already built? Just for practice? That's a differenct story then.
Also I think Joh6nn meant building this is harder, not using it!

whammy
01-23-2003, 11:22 PM
Might be hard if the page is hard-coded - but it's real easy if you're generating the page dynamically using server-side script... I often do this and create anchors on the fly from a database key or something (especially with FAQ type pages).

elson
01-24-2003, 01:20 AM
Thanks, all

This is the point: it is difficult to do or impossible?

I know how to do it using the good and simple html tags. But it is to use in ten or more pages with a hundred anchors each. In this case I prefer to use a script.

Sorry, Whammy, "server-side" is a very used excuse for some questions in this forum. So, I believe, server-side scripts can be a very useful model for this work.

Sorry, ConfusedOfLife, my practice is to discover a new and better way to do pages. "Wysiwyg" is more easy, no practice needed.

Sorry, Borgtex, nothing is necessary and the html tags are perfect and complete? So, what is the purpose of this forum?

Let's try some code now?

joh6nn
01-24-2003, 04:01 AM
i retract my previous statement; i no longer believe that this is just a bad idea. i am now reasonably confident, that it's impossible, too. to the best of my knowldege, there's no way to determine at what point in a page a string occurs, without using tags, which you said you don't want to do.