Forum Moderators: open

Message Too Old, No Replies

Several images linked by "onclick" rather than href

Which is the best method based on what google likes?

         

synergy

8:05 pm on Jul 18, 2003 (gmt 0)

10+ Year Member



There are several ways to do what I'm doing here.. and I'm wondering what the pros think is the BEST way in context to SEO efforts.

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);"

Dolemite

10:58 pm on Jul 18, 2003 (gmt 0)

10+ Year Member



Googlebot won't crawl any of those links...maybe that's what you're going for?

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.

synergy

11:20 pm on Jul 18, 2003 (gmt 0)

10+ Year Member



Actually, the php script that the links lead to are disallowed in my robots.txt so I'm not worried about them getting 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.

Dolemite

11:37 pm on Jul 18, 2003 (gmt 0)

10+ Year Member



I don't think there's any value in self-referential fragment identifier links. I doubt very much it would be considered spamming to load them up with keywords, though...I just don't think it would do anything for you,

Try it out and see what happens.

adamas

8:42 am on Jul 21, 2003 (gmt 0)

10+ Year Member



Don't forget about the people who browse with js turned off though. Putting the actual url in the href would help these people as well. Use the target attribute if you still want them opening in a new window.

(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.)

4serendipity

9:03 am on Jul 21, 2003 (gmt 0)

10+ Year Member



A good method for combining the richness of the javascript new window attributes (window size, location, etc.) while maintaining accessibility for users with a non-js user agent is to combine javascript with an HTML link as in the following example:

<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.

synergy

4:39 am on Jul 22, 2003 (gmt 0)

10+ Year Member



It's not that I'm using the javascript to hide the links (I've already done this via robots.txt). I use the js to open a new window to an affiliate link that does not show the address bar or navigation panes and displays at a certain size.

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.