Welcome to WebmasterWorld Guest from 54.146.174.220

Forum Moderators: open

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)

10+ Year Member



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 Jun 13, 2003 (gmt 0)

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



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 Jun 13, 2003 (gmt 0)

10+ Year Member



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

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



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.
 

Featured Threads

Hot Threads This Week

Hot Threads This Month