Welcome to WebmasterWorld Guest from 54.196.232.162

Forum Moderators: open

Message Too Old, No Replies

JavaScript: New Window and Robots

How to open a new window with javascript and still make the robots find it

     
4:02 pm on Jun 13, 2003 (gmt 0)

Junior Member

10+ Year Member

joined:Mar 14, 2002
posts:152
votes: 0


I am trying to find a way to open a new window for some links and still make the robots follow these links. I want to configure the new windows, so I think JavaScript is the only way to get what I want.

Somewhere, in an old thread, I found the idea to just do both - a normal link and a javascript link:

<a href="myurl.html" onClick="MM_openBrWindow('myurl.html')">My Link Text</a>

But now the link opens in the new window AND the old window as well. Of course I only want to open it in the new window. Any ideas?

4:05 pm on June 13, 2003 (gmt 0)

Senior Member

WebmasterWorld Senior Member blobfisk is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:Feb 25, 2002
posts:3185
votes: 0


You just need to inform the browser not to follow the default action by adding return false to you onClick event:


<a href="myurl.html" onClick="MM_openBrWindow('myurl.html');return false">My Link Text</a>

HTH!

4:09 pm on June 13, 2003 (gmt 0)

Junior Member

10+ Year Member

joined:Mar 14, 2002
posts:152
votes: 0


Thanks a lot, it works!
4:31 pm on June 13, 2003 (gmt 0)

Senior Member

WebmasterWorld Senior Member macguru is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:Dec 30, 2000
posts:3300
votes: 0


You could also add onLoad=window.resizeTo(WWW,HHH); in <body> tag of destination page, for the dual purpose of opening this window to the right size when visitors will be referred from a search engine, and the better serve the groing crowd surfing with JS disabled or Pop-Up killers.