Target named anchor when opening window

J

John

HI,

I was wondering if it is possible to target a named anchor in a frame when
opening a new window with a javascript function? has anyone actualy been
able to do this?

Thanks in advance for your answer

Sean
 
L

Lasse Reichstein Nielsen

John said:
I was wondering if it is possible to target a named anchor in a frame when
opening a new window with a javascript function? has anyone actualy been
able to do this?

window.open("http://www.foo.bar/dims.html#namedAnchorName","baz");

I.e., just as if you openend it with a link.

The global function "open" (a.k.a. "window.open") with two arguments
window.open("URL","targetName")
works just as clicking on the link
<a href="URL" target="targetName">CLICK ME!</a>
It is only if the target window/frame doesn't exist that the third
argument to "open" matters.

/L
 

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

Forum statistics

Threads
473,733
Messages
2,569,440
Members
44,829
Latest member
PIXThurman

Latest Threads

Top