views:

51

answers:

7

I have a website which requires javascript enabled to be functioning properly.

So this made me put a <noscript> tag right after the <body> tag inside a DIV:

<noscript><div align="center" style="border:solid; margin:5px; padding:5px; font-weight:bold; background-color:#F00;" width="800px">You don't have javascript enabled. Please enable it to use this site.</div></noscript> 

The problem is, that this is the first text (and almost only) after the body tag.

This makes search engines display the text inside the <noscript> tag in the SERP, which is bad.

My Q is, how can I solve this? Could I put a hidden DIV BEFORE the noscript and thus make the Search Engines display that text instead?

Thanks

+2  A: 

You could put it on the bottom and position it absolute on the top using CSS? Not the cleanest way, but then again.. having a website that doesn't work without JavaScript isn't either.. ;)

CharlesLeaf
The website is just a version 1.0... I will make it work without js in the future fyi.
Camran
Good to know! But besides that absolute positioning (or fixed, however doesn't work in IE6) is probably your best bet in this scenario! SEO wise it would be best if the first "text" in your website would be the content itself (from what I know.. I'm no seo specialist).
CharlesLeaf
A: 

You can wrap this text in an image. This is the best way in my opinion.

Sebastian Thiele
+1  A: 

Consider a text which would be appropriate for both users and bots, like

FooBars is a site which tries to grub every foo with a blinking bar. To best serve our customers, blah blah, you need to have javascript enabled.

Most search engines do not like to be tricked, and a hidden DIV would definitely count as a trick. Depending on whether Google detects it, they can lower your rank.

Sjoerd
A: 

Don't use hidden DIVs to steer what search engines show. You never know, there may be penalties.

Consider placing the noscript tag at the bottom of the page, and using

position: fixed; left: 0px; top: 0px; right: 0px;

(Doesn't work in IE6) or

position: absolute; left: 0px; top: 0px; right: 0px;

to place it at the top of the screen.

Pekka
Position:fixed is browser friendly? Works in major browsers?
Camran
@Camran yes, except for IE6.
Pekka
A: 

Why don't you do this: Create a static version of your site. Or at least a non-javascript version with text you want the SE to see. Then, when the page is loaded, replace that via Javascript with the actual contents.

Daren Thomas
A: 

Also, use <meta name="description"/> to change what search engines include inside the result detail by default.

bobince
A: 

Why not include the text you want to be displayed in the search result in the div within the noscript tag? Even if JavaScript is deactivated this would be more user friendly. Describe, what the site is about and then in the last sentence idnicate, that this site only works with JavaScript enabled (and maybe apologize for that ;-)

Dave