Forum Moderators: open
My situation: I have 24 widget themes with images and text being displayed on my index page. These widget themes are currently linked such as: <a href="" onlick="javascript:window.open('url to php page here')...>
What is the BEST way to link elements that are to be opened in a new javascript window?
1. Leave it like it is.
2. Make href point to "#"
3. Make href point to different keyword anchors somewhere on the page.. ex: href="#widget-templates", href="#widget-design", etc. (Remember I have 24 links here.. would this be too spammy?)
4. Call a js function that opens the new window via the href. ex: href="javascript.function(links);"
If you want them crawled, put the actual URL in the HREF and do whatever you need with JS in the OnClick using
this.href as your variable. Beyond that, I don't think there is a best way among your options. I don't think there's much keyword value in markup, and probably none in HREFs that can't be crawled.
I didnt know which (if any) would be the best method to use for good site design and for a google crawl. For instance with #3, if having the keyword anchors would be counted as spamming, or as actual links within the page by google.
Any insights to this? I know people with affiliate links would get great use out of this discussion.
(Then all you've got to worry about is the increasing people running pop up blockers who won't let you open any new windows.)
<a href="url to page" target="_blank" onlick="javascript:window.open('url to page'); return false;">
This way a user with a javascript-disabled browser will still be able to navigate your site, albeit in a less snazzy way.
However, if one of the reasons for using javascript links is to hide links from search engine spiders, than this method will, of course, not meet your needs.
Sounds like what 4serendipity said would be the best way to do this in lue of good site design. It still allows me to open the new window but also presents a href link for people that have js disabled (I hadn't even considered this).
Thanks.