4 ms·
> How are we meant to handle AJAX requests that fetch data to display on the web page that allows users to achieve the goal of their visit? Make the request fr
by Isofarro 13y ago
> How are we meant to handle AJAX requests that fetch data to display on the web page that allows users to achieve the goal of their visit?
Make the request from your server, parse it on your server, template it on your server, and deliver the HTML result to your user.
> Without JS enabled, that part of the page will be blank, and many modern, rich content-heavy sites now pull data from different places on the fly, it's just how it is.
Perhaps the developers of these modern, rich content-heavy sites can learn how to do their jobs properly?
> Is your idea of gracefully handling this situation putting a noscript tag there saying "please enable JS"?
No. It goes far deeper than that, naturally. Progressive enhancement ( https://www.gov.uk/service-manual/making-software/progressive-enhancement.html https://www.gov.uk/service-manual/making-software/progressiv... ) is about defining what is considered the core experience, defining the true value your site offers to your users, identifying the use cases that are utterly essential. It's these features that should be _implemented_ in a way that doesn't depend on JavaScript. So you build this layer first, and get it working. Then, you identify the enhancements, user experience improvements, the bells & whistles, and use JavaScript to fill in those gaps. Confident in the knowledge that should the JavaScript fail (for a plethora of different and uncontrollable reasons) the core experience will continue working. Then you consider the nice-to-have features, and decide how much of that is appropriate to incorporate as a core-experience level, and what improvements can be made with JavaScript.
- exodust 13y agoSounds cool, but speaking from recent experience, the option to make the request from the server, parse it on the server, template it and deliver it was not available to me for the job I was asked to do (as a frontend developer). Sometimes it comes down to doing it with client side AJAX, or not doing it at all. With developers learning to do their jobs properly, sure when the luxury of time and starting a new site from scratch is on your side. And with backend developers and engineers ready to configure the ultimate content delivery mechanisms. But what of when you don't have that luxury? What then? Just decline the job? Maybe, but then someone else will come along and do the AJAX, and get paid because the content appears when the site loads every single time (provided JS is enabled ;-).
- deleted 13y ago[deleted]