开发者

You must have JS enabled message?

What's the best way to implement a "you must have JS enabled" 开发者_开发百科message? My site simply won't work without JS at the moment.

Should I use the <noscript> tag? Should I hide the entire page's content, put a message about needing JS enabled, and then hide the message and show the content with JS? -- This might cause the message to be temporarily visible.

Is there a site I can direct my users to that describes how to enable JS in different browsers? Maybe a blurb about that stupid noscript FF addon too?


Use the noscript tag, that will only be visible when scripting is unavailable (i.e. disabled).

Additionally, you can initially hide some features using css and enable them with script.

Enabling scripting is specific for each browser, so you might have to link to several pages to cover all browsers used in your target group. This Microsoft page covers some of the most popular.


you could also hide the wrapper in the content like

<body>
    <div class="js-on">
       ...content here
    </div>
    <div class="js-off">
      warning: you must have javascript enabled
    </div>
</body>

.js-on{display:none;}
.js-off{display:block;}

and remove/toggle both classes with javascript. ;)

but as a fallfack for browsers that do not support css:

      <noscript>

-tag is the best solution

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜