Wednesday, 5 December 2007

Sneaky Javascript redirects

Using Javascript entirely legitimate web practice. However, use of Javascript with the intent to deceive search engines is not.

Example:
Placing different text in Javascript than in a noscript tag violates Google webmaster guidelines because it displays different content for users (who see the Javascript-based text) than for search engines (which see the noscript-based text).

Embed a link in Javascript that redirects the user to a different page with the intent to show the user a different page than the search engine sees. When a redirect link is embedded in Javascript, the search engine indexes the original page rather than following the link, whereas users are taken to the redirect target. Like cloaking, this practice is deceptive because it displays different content to users and to Googlebot, and can take a visitor somewhere other than where they intended to go.

Note that placement of links within Javascript is alone not deceptive. When examining Javascript on your site to ensure your site adheres to our guidelines, consider the intent.

Keep in mind that since search engines generally can't access the contents of Javascript, legitimate links within Javascript will likely be inaccessible to them (as well as to visitors without Javascript-enabled browsers). You might instead keep links outside of Javascript or replicate them in a noscript tag.

No comments: