W3C: <noscript> in meta refresh alternative

2.7k views Asked by At

To guide people without javascript activated i added a refresh meta in a function at my html 4 site:

<noscript><meta http-equiv="refresh" content="0;url=http://url.com/nojs" /></noscript>

I checked W3C validation and they said, this is not allowed.

So my idea was to put a div on top of my site that covers the whole site with a "Please activate Javascript" notification and hide it by default by javascript.

That works perfect. My only problem is, what google thinks about that. So it might look like i would hide the whole content behind a div, and also the first thing google will see is the "Please activate Javascript" notification.

What would you do? Just place the function in the header and donĀ“t care too much of W3C, or do the "cover-the-whole-site" thing?

Mmm....

2

There are 2 answers

0
deceze On

The real W3C and Google approved way to do redirects is with an appropriate HTTP status code and a Location header. Anything else is a hack to begin with.

1
SammyFM On

Ok, i found a solution:

I placed the <noscript> in my footer, set up a div with 100% with and height and an absolut position and a z-index of something really big ;)

So Google first will read my content and at LAST the No-Script notification.

What do you think?