Forum Moderators: Robert Charlton & goodroi
<script language="JavaScript"> // by Paul Davis
var txtList = new Array()
txtList[txtList.length]="Free%20Shipping%20on%20all%20orders%20over%20$50";
txtList[txtList.length]="Orders%20over%20$50%20recieve%20free%20shipping%20everyday!";
txtList[txtList.length]="Shipping%20is%20free%20on%20all%20orders%20over%20$50";
j=parseInt(Math.random()*txtList.length);
j=(isNaN(j))?0:j;
document.write(unescape(txtList[j]));
</script>
doesn't matter if it is or not...if Google's algo says it is. Why not use a php or perl thing?
on edit: I have no idea if javascript is Google's bad side or not, just saying.
It was not done to fool Google but to enhance our user experience. I don't think Google would have any problem with it, as long as it's not used very heavily.
If you want artificially fresh content, you may rotate some informations on the page, for example, always show different news. If you're sure Google would like it. I'd rather not use a script that randoms it every visit, but every hour/day depending how many crawls do you get, so there would be approximately 2-3 freshbot crawls per one content update - this would look more natural to G than serving different content every time.
As for javascript, I may be out of date right now, but a few days ago Googlebot still tended to ignore javascript. I did something that convinced be strongly about it.
I had problems with a site using frames. I described it in details here: [webmasterworld.com...]
but what's important for this discussion, I noticed that links inside NOFRAMES tag are not followed, while putting it in javascript <script type="text/javascript"><!-- document.write('<NOFRAMES>'); // --></script> leads to normal following of such links. Before hiding NOFRAMES in javascript this site received no deep crawling for months, while after doing it a complete crawl of entire site begun two hours after freshbot noticed the change. Pages were crawled by bots with both 'Googlebot' and 'Mozilla (Googlebot)' agents and are in the index since then, ranking perfectly.
For me it's enough to be sure Gbot don't care about javascript, even as primitive as I shown above. If you make javascript in external .js files, you can check server logs if any Google IP gets them.
But I agree that there would be sense in parsing javascript for Google, so I expect it to do it eventually, and I can't be sure they didn't start doing it just today. So I wouldn't risk doing any black-hat things with javascript. And it you intend to use javascript not to hide something from G, but to show it, I've got no doubt it won't work right now.
But seriously, we're just riffing off a topic. I take it for granted that at some point JS tricks get you in trouble. That doesn't mean that a script that shows the time will send you into SERP Hell.