Forum Moderators: open

Message Too Old, No Replies

Is this JavaScript link SEO friendly?

         

seogal

10:15 pm on Aug 1, 2007 (gmt 0)

10+ Year Member



Hey I was wondering if anyone knew if this linking was SEO friendly, its worked on all the spider tools i've used but I just wanted to verify:

<img border="0" onclick="document.location.href='/destinations/default.aspx';" onmouseout="removeselect('visible')" onmouseover="this.style.cursor='pointer';dropdownmenu(this, event, 'anylinkmenu1')" src="/images/home_nav.gif" width="152" height="64" />

Thanks

WesleyC

12:52 pm on Aug 2, 2007 (gmt 0)

10+ Year Member



A better way than the javascript onclick event might be to surround the <img> tag with <a> and </a> if at all possible. Use a standard href tag for the link to improve accessibility, and perform any additional "click" javascript in the onclick event of the <a> or <img>.

So, for your case:

<a href="/destinations/default.aspx"><img border="0" onmouseout="removeselect('visible')" style="cursor: pointer;" onmouseover="dropdownmenu(this, event, 'anylinkmenu1')" src="/images/home_nav.gif" width="152" height="64" /></a>

might work better. Also note that I moved your javascript code to set the style of the <img> to cursor: pointer; into an actual style--there's no need whatsoever for this to be done through javascript unless you actually want people with javascript disabled to not see the cursor you've picked.

penders

5:13 pm on Aug 2, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



...its worked on all the spider tools i've used...

I'd be very surprised if it was SE friendly. Are your spider tools SE spider simulators? For your link to be picked up the a SE, the SE spider would have to parse JS (albeit a very little bit), and as far as I'm aware, they don't?

Can anyone confirm this?

I'd certainly go with WesleyC's recommendation and use the <a> element.

seogal

8:24 pm on Aug 2, 2007 (gmt 0)

10+ Year Member



Yeah - I was really suprised too when the spider simulators picked it up. I thought it would be unfriendly for se's. I think I'm going to recommend the change to be on the safe side.