In quite a few answers to questions related to sending requests to servers, I see the use of Javascript/AJAX being advocated.
I'm still kind of a purist, in the sense that I try to develop sites that fully work without the use of Javascript/AJAX first and only add it to decorate the user experience.
I assume that quite a few people that seemingly effortless advocate the use of Javascript/AJAX are proffesionals too, so I'm kind of curious how, as a proffesional, you feel about this 'purist' approach? Is it passé? Do you feel with today's technologies/browsers you should just be able to depend on Javascript开发者_如何学Python/AJAX? Should I start to losen up a bit and be less strict with this approach? It would probably make developing a bit more easy in some parts. :)
Or is it dependent on your target audience?
It depends on your audience of course. But my opinion is that there are many cases where it's perfectly fine to require users to have a browser that supports ajax. Web sites are software. Software has system requirements.
I believe that you approach is good, you should always build pages that work without JS, but you can easily enhance them with JS in a way that users that have JS turned on will benefit from. You could load content through AJAX - users with JS on will get it faster, and users with JS off will have no problem viewing it.
Just try searching for Progressive enhancement and/or Graceful degradation
It depends on your target audience but if it's a public site then at least put in some <noscript> traps - even a full page warning - so that people with JS disabled aren't left with a screen full of UI elements that do nothing, or worse.
It depends on your audience and the nature of your site. I think the best way would be to make the basic stuff of the webpage JS free - navigation etc. (this way search engine bots are also able to browse through your site) and add all the complex stuff later - after the page load with JS.
So if the user doesn't support JS, he/she is still able to move around the site. But if JS is enabled, then it is possible to use all the bells and whistles.
精彩评论