Click to See Complete Forum and Search --> : simple javascript question


Ron of Japan
03-19-2003, 01:17 AM
Newbie question:

I want to link my logo to another page. The following link works fine except I would like to do it without opening a new window. Can anyone tell me how to do this?

<a href="javascript:window.open('http://www.MyPage.com/')"><img src='logo.gif'></a>

I suspect there is some code that you use for navigation in place of "window.open" but I don't know what it is. I tried using "nav" but it didn't work.

Many thanks!

Ron

cyberade
03-19-2003, 03:51 AM
There's more than one way to do this but try:

<a href="http://www.MyPage.com" target="_top"><img src='logo.gif'></a>

Ron of Japan
03-19-2003, 04:04 AM
Cyberade,

What you are suggesting is just straight html. I want to do it in javascript so that the link itself is hidden from the search engines. Can you tell me how to correct my code in javascript so that it works without opening a new window?

eevailen
03-19-2003, 04:39 AM
how about this?

http://javascript.internet.com/navigation/protected-link.html

but instead of the NewWindow, target it to the title of your first page?

tim_gor
03-19-2003, 07:34 AM
<a href="javascript:window.open('http://www.MyPage.com/', '_self')"><img src='logo.gif'></a>

Add a 2nd argument in the window.open function
It acts like the TARGET tag in HTML