Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AJAX & Disabled JavaScript. Do you worry?

I'm new to PHP, AJAX, and databases.

But I want to know what experiences programmers think and do.

When using AJAX, do you worry about users who have JavaScript disabled?

Do you have a backup solution? Or is the number of those who have JavaScript disabled so small that it isn't a concern?


Wow I got a lot of opinions, which is good, but I think it's important for me to clarify a bit.

I'm asking specifically in terms of AJAX in websites.

When it comes to JavaScript in my websites, I work with the goal of using it to ENHANCE the experience of the user, but ensure that the core of the site will still function for users with JavaScript disabled. But from my understanding of AJAX, it IS the core functionality is it not? It communicates with the server or database the way PHP does. So how do you make a fallback for that? Or do you?

Again, if I'm mistaken about the role of AJAX, please forgive and enlighten me.

like image 621
stefmikhail Avatar asked Aug 17 '11 23:08

stefmikhail


1 Answers

They key is to understand the viewers you are targeting. If your site is plenty useful without javascript, then it may be worth the extra effort to make a reasonable experience when javascript is disabled. You would have to understand the functionality of your site and targetted viewership to know whether that extra effort was worth it or not. There is no single correct answer here.

If your site isn't very useful when javascript is disabled, then it may not be worth the extra effort to try to do anything beyond tell the users that javascript is required. Why put in a bunch of extra effort (and a lot of extra testing) if those viewers won't be loyal to your site and be regular visitors anyway because the user experience will be fairly undesirable.

So, the answer is it depends a lot on what your site does, who your competition is and who your viewers are. Though people on SO like to argue with me in this regard (out of the purity of every web site should work for all - I think), it is getting harder and harder to justify the business case for the extra work for making many sites work without javascript these days. It, of course, depends upon the specifics of your site, competition and viewers. In my book, it is by no means a given that you should make every site work without javascript enabled.

If you Google, you can find articles that discuss how many users have Javascript disabled. This Yahoo article from mid 2010 says that they saw .25% - 2% of users with JS disabled.

As for Ajax specifically, there is no like replacement or fallback without Javascript. If you have a design that depends upon using Ajax for communicating with your server, then that design will require Javascript - period. Your only alternative would be to have a non-Ajax design (a more traditional page request from your server with one URL for one static page) that could be served instead that did not use Ajax. If your other design used and depended upon Ajax, this non-Ajax design would be a significantly different design and implementation.

like image 188
jfriend00 Avatar answered Sep 29 '22 19:09

jfriend00