开发者

Pros and Cons of an all Ajax Site? [closed]

开发者 https://www.devze.com 2023-01-17 05:36 出处:网络
Closed. This question is opinion-based. It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citations by editing
Closed. This question is opinion-based. It is not currently accepting answers.

Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.

Closed 8 months ago.

开发者_运维百科 Improve this question

So I actually saw a full ajax site somewhere (I forget where) and thought it would be something new and fun to try. I used an old site I had built and put it on a new server. With a little bit of jquery and ajax, I was able to make the entire site work on one page load.

My question is, what are some pros and (more likely) cons to this method?

Please note - the site works through a semi clever linking function. Everything works perfectly fine if the user doesn't have javascript enabled, the newly requested page loads like it would on any other website.

More detail -- Say the user loads the homepage of the site, then logs in. When they log in, the login box fades and reappears with user info. Other content on the page loads as necessary upon logging in. If they click a link, lets say "Articles", one column on the homepage slides up and slides back down with the articles. If they click home the articles slide up and the homepage content slides back down. Things like posting comments, viewing profiles, voting on things, etc. are all done through ajax.

Is this a bad method of web design? If so, why?

I am open to all answers/opinions.


IMO, this isn't "bad" or "good". That depends completely on whether or not the website fulfills the requirements. Oftentimes, developers working on AJAX-only sites tend to miss the whole negative SEO impact issue. However, if the site is developed to support progressive enhancement (or graceful degradation depending on your point of view), which it sounds like you have, then you're good. Only things to prepare for are times when the AJAX call can't complete as expected (make sure you're dealing with timeouts, broken links, etc) so the user doesn't get stuck staring at a loading icon. (The kind of stuff you'd have to deal with in any application, really.)

There are plenty of single-page websites out there using heavy JS and AJAX for the UI and they are great. Specifically, I know of portfolio sites for web designers and web app development teams that use this approach. Oftentimes, the app feels a bit like a flash app, but without the need for a special plugin.


"Is this a bad method of web design? If so, why?"

Certainly not. In fact, making web-pages behave more like desktop applications, whilst remaining functional to ALL users, is the holy-grail of web-design.


I say, as long as you consider ALL your users, i.e. mobile/text-only/low bandwidth/small screensizes then you will be fine. Too many developers just do it for their huge 19" screens and 10Mbps, that users to get left behind through almost no fault of their own.


It depends on the user

This relates closely to UX, IMHO, though of course it's on-topic for programming solutions.

All-AJAX is often called "managing state" 12 years after this Question was asked.

From my experience in:

  • Creating a platform for API plugins
  • Creating two of my own CMS web apps for different purposes
  • Managing many different WordPress.org sites for different purposes
  • Managing my own cloud servers for both PHP-AJAX and Node.js doing these calls

...it depends on what is most efficient for users.

Consider these scenarios:

  1. Will users be clicking around this website all day long or for at least an hour adjusting many different options and <form> inputs?
  2. Or will many users visit briefly to perform just a handful of quick tasks?

State-managed / all-AJAX is by far best for scenario 1, with Facebook and Gmail as prime examples.

Whole-page loads are more efficient for scenario 2, like blogs, especially with pages linked directly from search results. That might apply to webstores like Amazon, maybe, where users search Google to find one or two products, then leave.

Philosophically, I've heard that the difference is about the number of users and traffic, but I don't quite agree. It's more about how much clicking and <form> sending the primary target user will be doing.

0

精彩评论

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

关注公众号