tags:

views:

1133

answers:

6
+1  Q: 

Ajax versus Frames

In light of how ajax is actually used by most sites today; why is ajax embraced while frames are still regarded as a bad idea?

A: 

Ajax and frames are completely different from an accessibility standpoint (they're also completely different full stop). Frames offer very little positive effect but bring with them a host of negative issues. Ajax on the other hand makes the user interface more dynamic without compromising usability in most cases.

superfireydave
+3  A: 

AJAX, from where I'm sitting, is a sort of grand tradeoff. You are breaking things in the "document" model of the interwebs so that your site can behave more like an "application." If a site is using AJAx well, they will break the document model in subtle ways that add something of value to the application. The "vote" link isn't really a link, but it gives you a cool animation and updates the question's status asynchronously.

Frames break just as much, if not more, of the document model (bookmarks, scrolling, copy-and-paste, etc) but without as much of the benefit. Frames also insert whatever decorations my OS/Window manager happens to be using, so they look pretty ugly.

AJAX, if done correctly, also breaks better for people using screen readers, text-based browsers, etc.

Ryan
You can "do" AJAX without breaking the document model using unobtrusive javascript.
voyager
+1  A: 

With Ajax you can put all your logic in javascript code. That way you can create or use a javascript library that does not depend on your page. if you use an iframe, now you have to deal with a hidden control and most of your javascript code has to know the iframe.

Also for search engines work better if the page don't have frames.

Marioh
+1  A: 

Ajax gives you more granular control. You can update an individual element in a page, where Frames give you control of blocks that aren't even really in the same document.

Diodeus
+2  A: 

The big problems with frames are that it's possible to deep-link to the frames page outside of the frameset, and that bookmarking rarely works as expected. There are of course fixes for all these things, but they simply make an already not-very-nice system even clunkier and more complicated.

Ajax, as I have stated elsewhere, is more about bringing modern javascript to the mainstream and making it acceptable again than it is about using the xmlhttp object (which is really what the term AJAX means). Once you have a site on which javascript use is accepted and even expected, there's a lot more interesting stuff you can do with it.

Dan
+1  A: 

Here are two simple answers:

1) Just using the term AJAX is cool and makes your project sound more "Web 2.0". Frames is not sexy. In fact, in web terms, frames are the antithesis of sexy.

2) AJAX is forward looking even if used in non-standard or poorly supported ways. It is less likely, IMHO, to break moving forward compared to frames which is backward looking even if in the same manner.