View Full Version : hyperlink through Javascript
astro_sk
10-14-2002, 12:05 AM
[B]using the name attribute is an easy way to get a user to quickly jump to specific content on a very long page.
I am trying to do it from another page which is part of the same frameset but using javascript instead of using the
<a href="#name" target="framepagename">
I am not sure if it can be done but I would take any suggestions
tahnx
glenngv
10-14-2002, 02:19 AM
is this what you want?
window.open("anotherpage.htm#name","targetframename");
whammy
10-14-2002, 05:03 AM
Why is it taking so long? Using HTML anchors should be extremely fast.
Do you have a URL as an example? :D
astro_sk
10-14-2002, 02:37 PM
Originally posted by glenngv
is this what you want?
window.open("anotherpage.htm#name","targetframename");
the only problem with your code is that it opens a new window.
remember that it has to navigate an existing window within a frameset.
maybe something like
window.mainframe.moveTo(x,y);
the problem with this is that I would have to use x and y coordinates and I would much rather find a way to use name anchors.
any more takers?
adios
10-14-2002, 06:57 PM
Did you try glenngv's suggestion?
window.open() only opens a new window if the second argument (name) references a window/frame name that doesn't exist yet; if it does, it simply loads the url(first argument) into the existing window/frame. Should work.
whammy: relax, everything's under control. :thumbsup:
scroots
10-14-2002, 09:55 PM
you could use
window.franmename.loaction
scroots
whammy
10-15-2002, 02:11 AM
Do you think I'm a spaz, adios? ;)
I don't think that post was exactly frenetic... :p
I was just asking for an example of the "slowness" (while suspecting it might just be a graphically intense page)...
glenngv
10-15-2002, 02:13 AM
Originally posted by adios
Did you try glenngv's suggestion?
window.open() only opens a new window if the second argument (name) references a window/frame name that doesn't exist yet; if it does, it simply loads the url(first argument) into the existing window/frame. Should work.
whammy: relax, everything's under control. :thumbsup:
thanks adios :)
astro_sk, try this:
window.open("anotherpage.htm#name","framepagename");
where:
anotherpage.htm = target page
name = anchor name in the target page
framepagename = name of target frame
adios
10-15-2002, 02:15 AM
yo whammy...
Why is it taking so long?
Thought that was a non-sequitur....;)
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.