开发者

W3C: <noscript> in meta refresh alternative

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 i开发者_运维百科n the header and don´t care too much of W3C, or do the "cover-the-whole-site" thing?

Mmm....


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.


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?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜