Forum Moderators: Robert Charlton & goodroi

Message Too Old, No Replies

Content in Javascript document.write Is it bad for Google?

         

irock

4:12 am on Feb 6, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I was going to post this on the Javascript forum but since this has more to do with Google, I think this sub-forum is more suitable for this sub-topic.

Anyway, I added a top bar on my site to promote my RSS subscriptions. Since it's on top, I don't want that to 'contaminate' my content. So, I added the RSS bar to an external javascript document.write. Below is the code... I was wondering if this will be viewed as cloaking.

document.write('<div style="background: #ffc; border-bottom: 2px solid #fc0; margin: 0 0 5px 0; padding: 4px 0; text-align: center;"><div style="float: left;"><img src="rssicon.png" hspace=5></div><div style="width: 650px; margin: 0 auto;" class="bodytext">Subscribe my RSS via <a href="http://www.bloglines.com/sub/http://www.domain.com/rss.xml">Bloglines</a>, <a href="http://feeds.my.aol.com/add.jsp?url=http%3A/www.domain.com/rss.xml">My AOL</a>, <a href="http://fusion.google.com/add?feedurl=http://www.domain.com/rss.xml">Google</a>, <a href="http://add.my.yahoo.com/rss?url=http://www.domain.com/rss.xml">My Yahoo</a></div></div>');

Wizard

7:16 am on Feb 6, 2006 (gmt 0)

10+ Year Member



I often use this technique in SEO, and never got penalty for this. Sometimes I include the header and navigation this way - it additionally reduces bandwidth and speeds up page loading time, as browser has the js file already in cache when user opens next page of the site.

The content in javascript usually is not indexed and links in it not followed by Googlebot, however there are exceptions. But always you achieve the goal to avoid 'contaminating the content' at the beginning of the page.

The alternative is to put the content at the bottom and use CSS to move it to the beginning of the page, but this makes sense only if you _want_ the content to be indexed, but not at the beginning of the page.

As links hidden in document.write are usually not followed, remember to put them somewhere else on the page (in footer for example) if you want them crawled and followed.

irock

7:31 am on Feb 6, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I have a strong feeling that Google will eventually look at my rss.js (the external script) to see if I'm putting a whole bunch of stuff in there.

But then, cloaking technique involves flooding keywords to Google spider while hiding them from human visitors.

Putting external javascript, on the other hand, works the other way around by hiding stuff from spider and showing them to humans.

Wizard

6:00 pm on Feb 6, 2006 (gmt 0)

10+ Year Member



There are more purposes to use document.write than to cheat Google - and this is a reason they cannot put automated penalty for just using it.