开发者

Website doesn't work with Javascript turned off

开发者 https://www.devze.com 2023-03-19 02:09 出处:网络
So head to www.jabsy.com, with Javascript turned off. Basically, I use some JQuery UI Dialogs, I use Javascript for all the bindings on the page...I pretty much use it for everything. Is that really

So head to www.jabsy.com, with Javascript turned off.

Basically, I use some JQuery UI Dialogs, I use Javascript for all the bindings on the page...I pretty much use it for everything. Is that really a bad thing though?

Nothing really works without Javascript. Not even the Google Maps API.

Should I go out of my way to try and make the entire page work without Javascript? Is that even possible with my site? I wouldn't even know where to begin as I use Javascript for everything, so could I get some points? How many users actually turn off their Javascript these days?

Would it he开发者_如何学Clp to let the user know if they have Javascript turned off and make them turn it on before accessing it and provide them with directions how?


Yes, if your site requires JavaScript you need to let the user know that it is required.

For example:

<noscript>
  <div>
    You need to have JavaScript enabled to use this site.
  </div>
</noscript>

You can provide more description as appropriate. A savvy user that sees this text is going to be able to then go in and turn on JavaScript for your site. A non-technical user might have trouble, but I would think most of them would be running with JavaScript enabled anyway (?).


According to data collected in 2007, about 3% of users in the US have JavaScript off. I'm sure that number is lower today.

It really depends on how critical the sections of your page that require JavaScript are. If there is a form that is mission critical, but controlled completely by JavaScript, you probably want to engineer a way for that form to do the same thing with JS on and off.

However, you have animated snowflakes on your background (for the love of God, don't really do this), it's not going to negatively affect someone visiting your site with JavaScript off.

Really, it all comes down to how important the information or actions are to your site. Turn off JavaScript and note all the things you can't do that are absolutely vital, then make them work.

Keep in mind there are several audiences that will not render your JavaScript:

  • Screen readers/accessible browsers
  • Console-based browsers (Text based browsers)
  • Search Engines (Google)


Your specific service (location-based messages) will be way too cumbersome to use without JavaScript (and its content is dynamic). Therefore, I see no problem requiring it. You should, however, point out that JavaScript is necessary to use your site (Preferably at the top, in really large letters). You can do that by including the alternative no-JavaScript content in noscript tags, i.e.

<noscript>
<div style="font-size: 200%;">You need JavaScript!</div>
</noscript>

However, most websites are content-based, like a company's homepage, stackoverflow or Wikipedia. These websites should be usable without JavaScript. Nowadays, even smartphones have excellent JavaScript support, but Kindle and regular phones are still too slow for JavaScript.


There is a line of argument that says sites should work without JS. Personally, I think that is tosh, unless you have a clientelle for whom this is liable to be an issue. JS is a reasonable thing to expect for many sites.

However, it is polite to let people know that this is a requirement, and inform them rather than just letting it not work. If your site is heavily JS dependent, then you may have made some mistaken design decisions, but it is probably not worth re-working it. If you monitor the number of people who get the "you need js" message, you will identify if it is proving a turn-off. I suspect it will not be an issue.

So build based on what you need, BUT tell people if they need to have things set.


You can use the <noscript><!-- html here if no Javascript --></noscript> tags and place content to be rendered in between if javascript is turned off.

I don't think there are many sites that will work with these days without it. It's more or less mandatory.

0

精彩评论

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