Sponsored by Best Buy
The camera starts rolling on Best Buy holiday campaign. view!
www.youtube.com/bestbuy - A behind the scenes look at one employee’s singing debut.
24 Comments
- canUdiggit, on 10/12/2007, -0/+3@BluParadox - Well said. I agree that everyone is going nuts with AJAX and there is a lot of overuse of the concept. Your entire app should not be comprised of tiny async calls, this is not what it was intended for. It should be icing on the cake, not the cake itself. Right tool for the right job.
- enygmadae, on 10/12/2007, -0/+2You should also check out his other project - AMASS at http://codinginparadise.org/projects/storage/
"The AJAX Massive Storage System (AMASS) uses a hidden flash applet to allow JavaScript AJAX applications to store an arbitrary amount of sophisticated information on the client side. This information is permanent and persistent; if a user closes their browser or navigates away from the web site, the information is still present and can be retrieved later by the web page. Information stored by web pages is private and locked to a single domain, so other web sites can not access this information."
it's pretty slick as well...Brad's on a roll :) - smhill, on 10/12/2007, -0/+2"If your AJAX usage would break the back button then you are using AJAX in a way it shouldnt be used. If users expect to go to a new page then you should go to a new page, if users expect to change some aspect of the current page then you can use AJAX. Users wont expect the back button to work for minor changes within a page (like unrolling some heading), but otherwise AJAX is a bad idea and un-neccessary."
- BluParadox
Amen. This starting to become silly. Ajax is a nifty tool and it has some great uses, but it is quickly going overboard. Much like flash did several years back turning people off to it.
Ajax is not for making full sites, or a new technology by an stretch of the imagination. It is simply one more tool in a developer's toolkit. - BluParadox, on 10/12/2007, -1/+2No one else say the IE6+/NS7+/No safari that makes this pretty useless? Frankly, even it it were perfect you shouldnt need it anyway. If your AJAX usage would break the back button then you are using AJAX in a way it shouldnt be used. If users expect to go to a new page then you should go to a new page, if users expect to change some aspect of the current page then you can use AJAX. Users wont expect the back button to work for minor changes within a page (like unrolling some heading), but otherwise AJAX is a bad idea and un-neccessary.
I really can't understand the obsession with this AJAX stuff... And the AMASS thing mentioned by enygmadae will not let you store and arbitrary amount of stuff. The user can limit how much flash is allowed to use for each domain. I believe the default is 100k, but it could be 0. It's basically just an implementation of cookies only in flash. - nthitz, on 10/12/2007, -0/+1The article clearly states no Safari support. Also changes to the DOM are not saved. It isn't perfect yet. But its getting there.
- spyhunter, on 10/12/2007, -0/+1enygmadae: That's pretty lame because it requires flash and doesn't have much of an advantage over cookies, which can store 80K of info per domain if you split up your cookies, and you can use several domains to cheat and get more storage. A javascript library could easily automate splitting the cookies and using extra domains, and thus get 160K of storage or more without asking the user and without requiring Flash. Besides, if you need to store that much info on the client, your web application is broken.
OTOH, fixing the back button and bookmarks and sending links to other people is very important and impossible to do without the hack from this article. It's way cooler. - bakdraft, on 10/11/2007, -0/+1hi, i found a full ajax website, and the back button works : http://itbreaks.net
- 3354, on 10/12/2007, -0/+0"I really can't understand the obsession with this AJAX stuff"
The craze is simple. AJAX is what Java never was, but claimed to be.
*You can Run Anywhere
*You don't need a certificate
Why shouldn't everything be in AJAX? Back when operating systems where becoming popular people said "the right tool for the right job" but now everything is there. - torunforever, on 10/12/2007, -1/+1You can't have ajax without javascript and not everyone enables javascript.
- thewoz, on 10/12/2007, -1/+1In Firefox, I've never had a problem using the back button... But after I switched to Opera (I saw the light) I noticed issues related to the back button and AJAX.
--Completely off topic? Yes, but whaddya gonna do? - bsharitt, on 10/12/2007, -0/+0I really wish Google would fix the back button in GMail. That gets annoying aftera while.
- skeeto, on 10/12/2007, -0/+0AJAX seems to be where things are going. I've seen industry magazines like eWeek write more articles about it.
- command-tab, on 10/12/2007, -0/+0This is great - it should be implemented everywhere there's AJAX. The same goes for fixing the Back button functionality.
- Tufriast, on 10/12/2007, -0/+0WHOA! This is big stuff! Seriously, this is the ONE flaw with AJAX. I can't believe it!
- smhill, on 10/12/2007, -0/+0Not really how it works.
It makes sense to use if the benefits outweigh the costs. (both client side and server side)
Let's use your digg example. First off, digg pages are very small indeed. You full reload is minimal. A few bytes at best, not a "lot of data" by any stretch of the imagination. Even if you just add your comment, the cost is context. suppose comments have been removed or added since you last viewed the page? Just putting up yours breaks the integrity of the data. Logically the best step reload all the comments to ensure context. The comments comprise the largest part of the page. So any benefits this would bring are offset by the additional javascript needed to do it.
Additionally, to ensure accessibility, the developers would have to provide methodology to have the same functionality should the user not have javascript on, be viewing it from a different device or a non-compliant browser. So the cost their is maintainability on the code side. Meaning updates to two ways to post comments. This can be minimized but good code, but none the less, it is a consideration that would have to be taken into account.
What about benefits server-side? On a site like digg, they would be minimal or non-existant. The biggest chunk is going to be db activity and that would not change. Good coding would keep the display side to a minimum in the first place so the cost/benefit would be pretty much null.
Client side, as I said above, the code being sent to your browser would have minimal impact. Client-side scripting would take minimal additional resources, and graphics and images are cached so a page reload would have little impact. Additionally, if you go back or forward in your history, the pages would not reflect the correct content you last saw. (unless you used the hack in this article, and then you vastly increasing client side activity and page size). Also if you consider, there are probably more people reading than posting. So, if you are not posting, adding ajax for comments is additional code required that you are not going to use. Look at how many people dugg it vs. posted comments? Wasted bandwidth.
So, to be beneficial on digg, you would have to return all the comments, which is no savings on the client or server. Or if you didn't you are losing content integrity at a minimal savings to the client. In the end there would be no real savings or benefit, other than a) to be OMGAJAX!!!11 and b) give the appearance of "instant" action. (no visible refresh)
It is not about "old paradigms". In fact going balls out and ajaxifing everything in sight would be very much the old paradigm. Doing flashy, poorly thought out stuff because it all the rage. That is exactly what standard practice in on the web in general.
More and more the new paradigm is designing web applications with thought and concern to use the methods and technologies that best fit the need and provide the best possible solutions to content delivery. On occasion, javascript and remote data requests are an excellent solution for that. Most often for common things, they are not. Comments on a web blog/bbs/news thingy are an example of flash without substance that probably are best benefited by using a traditional method.
By contrast, using ajax to "digg" an article is perfect fit. Quick solution, you only need to return a number, minimal server-side and client-side activity.
Like everything, right tool for the right job. - smhill, on 10/12/2007, -0/+0"Ajax" is just javascript. That is all. It has been around for a quite a while. More recently people have using the xmlhttprequest object because the moz and safari now support it. And more often than not it is used to return html not xml. So in many (if not most) cases the acronym is "ajax" is incorrect. It is client side scripting that accesses remote data.
It doesn't "run anywhere". It runs on modern javascript enabled browsers. Flash is capable of everything that "ajax" is, and has been for much longer. However most people were more concerned about making crappy animations and music when it comes to flash that scriptablitily and communications. "Ajax" seems destined for this route as well as more and more wanabees pick up prebuilt libraries and integrate in their site with actual concept of what it does or what it can be used for.
As evidenced here on digg by the numerous articles of "OMG Sweet AJAX site!" and it is more often than not just some simple javascript and has nothing to do with remote requests or xml.
It is not "where things are going". It is simply a tool like any other. Good uses and potential, often abused and overstated/hyped. - Quest-Master, on 10/12/2007, -0/+0AJAX can really go mainstream, with people not pissed off about its behavior, with this.
- indiefan, on 10/12/2007, -0/+0well put, smhill.
Pragmatically I can't really argue with anything you said. I definitely agree that an "old paradigm" of the Internet is to over-embrace anything flashy and new.
However, I still feel ajax is the "right" solution for an issue like comments. Yes, for contextual purposes you would need to refresh all the comments and on a site like digg or most sites even this will only save you little, but just because it's not as easy as simply reloading doesn't mean it's not the proper solution. Ironically, I think a perfect example of why it is the proper solution can be found with the browser's "Back" button. I think ideally if I were to visit the digg homepage, click on an entry, then post a comment, the back button shouldn't take me to the entry view sans my comment, it should take me back to the digg homepage.
As far as "wasted bandwidth" i think the decision to send the javascript to handle a comment submission should be the same decision as deciding to send the form itself. I never claimed javascript http requests would save time, money, or bandwidth. I said it doesn't make sense to resend information that is currently displayed on the page.
The paradigm that i see changing isn't the "Doing flashy, poorly thought out stuff because it all the rage." one that you mentioned and i completely agree exists. It's the browser paradigm that i see evolving. I see the browser evolving in functionality almost to the point where in many cases it is a psuedo-shell used for launching Internet applications.
I know that it's hard to develop things the "right" way when it's clearly not the easiest or cheapest way. I think it's sad that it took "accesibility" and alternative devices to start writing semantic standards-based xhtml when clearly it was the "right" solution for a long long time. I hope the day comes when things like reloading a page for comment submissions is just as inappropriate as using tables for layout and presentation. - smhill, on 10/12/2007, -0/+0"I think it's sad that it took "accesibility" and alternative devices to start writing semantic standards-based xhtml when clearly it was the "right" solution for a long long time."
I couldn't agree more. You shouldn't have to have additional reasons for simply doing things the correct way. Accessibly and alternate devices should just be a side benefit of proper development not a driving force.
I disagree on your point about comments (in the context of a site like this), but your arguments are valid and well stated. It boils down simply a difference of opinion which I am fine leaving it at.
And I fully concur with your points about browser functionality. I develop web applications professionally, and with modern web browsers and support of dom, css and remote scripting, whole new options are available to how far it can be pushed and still stay in realm of standard technologies without having to rely on plug-ins. And of course faster computers and connections make it more viable as well. (and frameworks like rails). Flash has all these possibilities, but is limiting in terms of development (as is activex and the like).
It is a fun time to be doing web development. - indiefan, on 10/12/2007, -0/+0i disagree with most of you, i think more sites are sending you to a completely new page (or reloading an entire page) when really only one element of the page has changed. I don't need to reload the entire digg article and every single comment leading up to mine when i post a new comment. Really i just need to the comments to refresh.
I agree that AJAX is a buzz word that's going around and people have been using hidden frames and dom scripting to accomplish the same thing for a while, but i think it's going to become a ubiquitous technique because it makes sense. Even more so as i hit the "submit comment" button and watch as i make a request to the server for a lot of information that i ALREADY HAVE. You people are so fixed in the current Internet paradigm that you don't realize how ridiculous that is. - republicoftexas, on 10/12/2007, -0/+0What does this have to do with cleaning soap scum?
- timeisapear, on 10/12/2007, -1/+0gmail has a back button btw
- psylence, on 10/12/2007, -4/+1create digg.filter
where article.title NOT LIKE '%ajax%'; - ScottyTee, on 10/12/2007, -5/+0"This is great - it should be implemented everywhere there's AJAX. The same goes for fixing the Back button functionality." - Agree 100%
--
http://www.diggfans.com


What is Digg?
The Digg Toolbar for Firefox lets you Digg, submit content, and keep track of Digg even when you're not on the Digg site. Download the official