views:

33

answers:

1

Hi All,

I would like to show a div near the top of a site to suggest to visitors that do not have javascript enabled that they should enable their javascript. I thought I had found a good method by using the noscript tag.

Unfortunately I found that this solution was less than ideal because of services like Google's indexer and Facebook's link sharing functionality. These services scrape the page and read the text in the noscript div as the summary of the page. This happens because these services are not utilising javascript (obviously).

So, my question to the masses is: What techniques do you prefer for avoiding having your "please enable your javascript" messages appearing in Google's results etc.

Ideally, I'm hoping to discover the best practice for solving this issue, but am interested in hearing any techniques you have user successfully, or unsuccessfully in the past.

Thanks!

+1  A: 

In a pure HTML scenario (as tagged), consider placing your message at the bottom of the page, and using CSS to position it visibly at the top. This should push your warning far enough down the page as to avoid it showing up in typical search results.

If your HTML is generated by server script, then you may be able to conditionally present the element based on the client UserAgent. A good search engine user agent list would be convenient in this case.

kbrimington
Thanks for that, it definitely got me on the right path. I also got inspiration from this question: http://stackoverflow.com/questions/993387/noscript-tag-javascript-disabled-warning-and-google-penaltyI have ended up doing something similar to what stack overflow uses, but with the addition of a "find out more" link as my users are not as technical as this site.My solution ditched the noscript tag, instead opting to hide the message divs with javascript, but this is interfered with by firefox when prompting for my master password, so I think I will go back to noscript. Thanks again.
zizee
@zizee: Glad to help. Good luck!
kbrimington