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 es 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 municates 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.
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 es 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 municates 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.
Share Improve this question edited Aug 18, 2011 at 2:02 stefmikhail asked Aug 17, 2011 at 23:24 stefmikhailstefmikhail 7,14513 gold badges48 silver badges61 bronze badges 3- 1 this questions been answered before and non intrusive javascript, search. – m4tt1mus Commented Aug 17, 2011 at 23:30
- 1 I worry that they might be stuck in a decade not known for its memorable dress style, yes. – Lightness Races in Orbit Commented Aug 17, 2011 at 23:53
- You mean the times when we actually needed to deal with javascript problems within browsers and not javascript problems because of users? – hakre Commented Aug 18, 2011 at 1:06
3 Answers
Reset to default 8They 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 petition 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, petition 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 municating 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.
When creating a website, the key is to create a site that works regardless of the user's settings. Your site's design and functionality should not be dependent on the user having Javascript enabled.
Just make a container around everything and set the display to none using CSS. Set "onload" to a JavaScript function that sets the display back to "block". This way, only stuff in the "noscript" tag will show when JavaScript is disabled. You can use it to say that your web application uses AJAX, ect. I like to showcase a privacy policy that NoScript users will be happy about on these fallback pages.