Slashdot Mirror


Better Web Apps With Ajax

An anonymous reader wrote to mention an article on IBM's site detailing the fundamentals of Java-based Ajax. From the article: "This article gives you a good understanding of the fundamental principles of Ajax, and a nuts-and-bolts knowledge of the client and server side components that participate in an Ajax interaction. These are the building blocks of a Java-based Ajax Web application. In addition, you will be shown some of the high-level design issues that come with the Ajax approach."

184 comments

  1. With AJAX, you know you've got by knightinshiningarmor · · Score: 3, Funny

    Cleaner code than the rest!

    1. Re:With AJAX, you know you've got by Shadow+Wrought · · Score: 2, Funny

      One comet in and my joke's already taken. You do what you can.

      --
      If brevity is the soul of wit, then how does one explain Twitter?
    2. Re:With AJAX, you know you've got by mcclure · · Score: 2, Funny

      ... with your code whiter than white!

      hrm - on a white background, that's not goin' to work so well...

    3. Re:With AJAX, you know you've got by temojen · · Score: 5, Funny

      Here's a screenshot:












    4. Re:With AJAX, you know you've got by Spy+der+Mann · · Score: 1

      Cleaner code than the rest!

      Just make sure you TIDY it, or it won't work ;-)

    5. Re:With AJAX, you know you've got by fossa · · Score: 1

      Clean?? There are greasy fingerprints all over!

    6. Re:With AJAX, you know you've got by miscGeek · · Score: 1

      Sure it will, code obfuscation for free :)

      --
      May the source be with you!
    7. Re:With AJAX, you know you've got by CalexAtNoon · · Score: 1

      Yes it is :)))

    8. Re:With AJAX, you know you've got by Metteyya · · Score: 1

      Hey, that'd mean AJAX compiles every code to WhiteSpace! Kewl!

    9. Re:With AJAX, you know you've got by hotdiggitydawg · · Score: 1

      Cleaner code than the rest!

      I wouldn't be so sure. I'd like to see some benchmarks against Linux...

    10. Re:With AJAX, you know you've got by LogicallyGenius · · Score: 1
  2. Two camps by sexyrexy · · Score: 4, Insightful

    I'm glad to see another serious technical article on the pros and cons of implementing an AJAX solution. Most everyone who says the acronym "AJAX" usually falls into one of two camps - either the "OMFGZ teh AJAX is so amazing! It will change the interweb!" How? Oh, it allows parts of the page to be updated without a refresh. How interesting. Perhaps you could go a little more in-depth? No? Thanks...

    The other camp... too many Slashdotters, IMO... feel the need to flex their superior understanding of the fundamental dynamics of the internet and development and offer this gem: "AJAX is just an assortment of pre-existing technologies. Nothing to see here".

    The automobile was just an assortment of pre-existing technologies, and it radically changed the world. It also introduced a whole bevy of new challenges, both technical and otherwise, that we still haven't fully figured out yet. It was not a transportation panacea, and AJAX is no cure-all. But just because it doesn't solve every problem doesn't mean it doesn't have the power to be revolutionary.

    --

    Rex is 09 F9 11 02 9D 74 E3 5B D8 41 56 C5 63 56 88 C0
    1. Re:Two camps by museumpeace · · Score: 4, Informative

      It is not so much the technology as the economic might of the one of the biggest developers of AJAX: Google. They are giving a wall to wall 24x7 demo of AJAX technique and its effectiveness to anyone who pays attention. The fact that middleweight clients that can support a bit of asynchronous update traffic in what , to the user, is the "background", is not so much technically amazing as perceptably practical and a better web experiance. I was looking for better doc on AJAX, having first got the impression it had to be JavaScript [which, frankly, is a crappy tool for designing ambitious software]. This article is a good addition to a topic that doesn't have much presence in the bookstores yet. There are other sources on line. Its not just for XML and its not just a J language either... Ruby will do.

      --
      SLASHDOT: news for people who can't concentrate on work or have no life at all and got tired of yelling back at the TV.
    2. Re:Two camps by GaelTadh · · Score: 1

      If you haven't seen it yet the splunk log analysis engine is a really neat use of ajax. Theres a live demo up on the site so you can check it out without having to go and install it.

      ( Fulldisclosure : I do work for splunk but I still think that the gui and engine rock ! )

      --
      Search your logs like the web: splunk!
    3. Re:Two camps by Jambon · · Score: 1
      Most everyone who says the acronym "AJAX" usually falls into one of two camps...

      Well, to be really fair there is a third camp

    4. Re:Two camps by prockcore · · Score: 1

      How? Oh, it allows parts of the page to be updated without a refresh. How interesting. Perhaps you could go a little more in-depth? No?

      Well, one of the things we use AJAX for is to prevent two people from modifying the same story. AJAX hits the server every 10 seconds with a basic "My name is Bob and I'm modifying story 197342". Then if the user's browser crashes or if they just close the window, the story will auto-unlock after 10 seconds.

      This doesn't really "change everything!" but it's just one more thing that makes things run smoothly.

    5. Re:Two camps by Osty · · Score: 1

      "AJAX is just an assortment of pre-existing technologies. Nothing to see here
      The automobile was just an assortment of pre-existing technologies, and it radically changed the world. It also introduced a whole bevy of new challenges, both technical and otherwise, that we still haven't fully figured out yet. It was not a transportation panacea, and AJAX is no cure-all. But just because it doesn't solve every problem doesn't mean it doesn't have the power to be revolutionary.

      The car analogy is close, but you got it wrong. The second camp is not so much saying that this is a bunch of stuff that already existed and is being glued together in new ways. They're saying that the exact same grouping of existing technologies that make up AJAX have existed for years, and that the only thing new is the name.

      To fix your automobile analogy, consider that cars existed in one form or another for decades before Henry Ford's Model T (depending on your definition of automobile, you could go all the way back to the 1770s for steam-powered machines, but gasoline-powered ICE-based automobiles have been around since 1886). The Model T is widely credited with bringing the automobile to the masses, but it's absolutely no different than any of the other cars that came before (besides how it was manufactured and that it was more affordable). AJAX is like the Model T, taking an already existing concept and giving it a name and framework to make it more palatable. The people driving cars for decades before the Model T probably felt similarly to those who've been using AJAX long before there was the AJAX name, specifically, "What's the big deal? I've been doing that for years!"

    6. Re:Two camps by e2d2 · · Score: 1

      But just because it doesn't solve every problem doesn't mean it doesn't have the power to be revolutionary.

      And it probably is.. But so what? We're developers and we're constantly in the middle of the next revolutionary technology. Christ most of us just want to take a frickin breather and make sure we do it right. The next big thing(tm) is constantly in our ear, ITS HERE! ITS HERE! THE NEW PHONE BOOK IS HERE!

      So don't be surprised when we *yawn* while accepting the inevitable new shiny baubble

    7. Re:Two camps by mblase · · Score: 1

      The other camp... too many Slashdotters, IMO... feel the need to flex their superior understanding of the fundamental dynamics of the internet and development and offer this gem: "AJAX is just an assortment of pre-existing technologies. Nothing to see here".

      It's not that AJAX is just an assortment of pre-existing technologies. It's the fact that it's nothing more than that -- there's no AJAX development tools, no IDE, no solid definition of what it is or isn't. The definition of AJAX pretty much begins and ends with "JavaScript and DHTML plus server-side database-driven code".

      AJAX is great, yes... but it's just a name, not a thing.

    8. Re:Two camps by Anonymous Coward · · Score: 0

      My "I'm above this" post is better than yours.

    9. Re:Two camps by gaspyy · · Score: 1

      For that matter, see Flash Earth

      I now the majority of /.-ers think Flash is only for ads, but actually you can do everything Ajax with less effort.

    10. Re:Two camps by Tim+C · · Score: 2, Informative

      Its not just for XML and its not just a J language either

      Technically, the X in AJAX is XML, while the J is JavaScript, so yes AJAX is just for XML. You can do the same sort of thing using whatever technology you want, of course, but to do AJAX requires:

      a browser
      XML
      JavaScript

      The server can be written in anything you want, as long as it can receive HTTP requests and interpret XML. You're free to implement AJAX-style functionality using whatever collection of technologies and languages you wish, but unless you're using the above three things it's not AJAX. For instance, while you could replace JavaScript with VBScript (in IE), that'd more correctly be called AVAX.

      Personally, I think calling AJAX AJAX is stupid, as it leads to the sort of misunderstandings that you seem to have, but I guess most people like to have short, snappy names for things.

    11. Re:Two camps by Sithgunner · · Score: 1

      Third camp.

      AJAX -
      "Wow, great name given to what people have been trying to accomplish with what has been the limitation of web. Now let's make some decent web apps."

      This technology shouldn't just get tossed to either, 'wow cool buzzword' boys and 'yeah yeah, nothing new' guys but it quite has good potential, yet people still don't seem to realize too deeply.

      People who realized this technology with the buzzword only won't maybe realize it...

    12. Re:Two camps by TLLOTS · · Score: 1

      Personally I quite like the idea of AJAX, that of being able to dynamically update web pages, however I'm not sure I'd consider it revolutionary in enabling that. However there is one thing I am curious about is why I should use AJAX over an alternative such as a hidden iframe? Certainly, the AJAX approach will likely be cleaner, as working with iframe's can be a pain to put it lightly, but in doing so I would sacrifice some browser compatibility, not necessarily a vast amount, but enough to cause me some degree of consternation for products I would hope to sell.

      I'd like to hear opinions from web developers who have worked with both as to what you view the pro's and cons to be, as I'm unfortunately still quite inexperienced in these matters, having only started training in web development this year.

    13. Re:Two camps by Alf+Gored · · Score: 1

      I would agree. Splunk is a cool ajax app (props to SirNick) that's really good at sucking my /var/logs.

    14. Re:Two camps by NoOneInParticular · · Score: 1

      And a fourth.

    15. Re:Two camps by Bob+Uhl · · Score: 1

      Ajax requires JavaScript; it doesn't work in links or w3m (or emacs-w3m). It is, therefor, missing the whole frickin' point of the World Wide Web. A RESTful approach is much better.

    16. Re:Two camps by elemental23 · · Score: 1

      Technically, the X in AJAX is XML, while the J is JavaScript, so yes AJAX is just for XML.

      It's actually a bit of a misnomer. Despite its being called XmlHttpRequest, there's no reason you actually need to work with XML. You can use HTML or even plain ol' text just as well.

      --
      I like my women like my coffee... pale and bitter.
    17. Re:Two camps by CaptnMArk · · Score: 1

      It seems somehow much slower than the original ajax version here.

  3. Atlas by ThinkFr33ly · · Score: 5, Informative

    Atlas is Microsoft's entry into the suddenly-popular-even-though-it-has-been-around-fo r-7-or-more-years AJAX trend.

    Atlas is a set of extensions to ASP.NET 2.0 that allows for web developers to use AJAX with little or no plumbing work on their part.

    It integrates with ASP.NET extremely well and maintains the "event driven" style that ASP.NET is known for.

    There is also a Channel 9 video about what Microsoft is doing on the AJAX front elsewhere.

    1. Re:Atlas by badriram · · Score: 2, Informative

      Microsoft entered AJAX when they created XMLHTTP, and used it in OWA. They just created easy to use developer APIs in .Net now. Dont get me wrong, I am liking Atlas, it is a very good framework, and takes care of a lot of plumbing that i know would have taken me years to write.

    2. Re:Atlas by ThinkFr33ly · · Score: 1

      Yes, you're absolutely correct. That's partially what I was getting at with my very-long-sarcastic-description of AJAX. :)

    3. Re:Atlas by oni · · Score: 1

      Microsoft's entry ... integrates with ASP.NET

      uh huh. And there's the problem right there. I know that a lot of people like .net and I'm not trying to start a flame war, but there is a group at the university where I work that does all their development in .net and here's what I see from them:

      When they develop something and it doesn't quite work right on any browser that runs on a mac
      "oh, well we'll have to tell the users that this app requires IE on windows XP."

      When they develop something and it doesn't quite work right in firefox
      "oh, well we'll have to tell the users that this app requires IE on windows XP."

      When they develop something and it doesn't quite work right in opera
      "oh, well we'll have to tell the users that this app requires IE on windows XP."

      etc. etc.

      Now, I do a little web monkeying myself and I'm quite good in regular asp, macromedia coldfusion, php, and perl. My last big project at work was a class registration system. When a popup help window didn't quite work right on a mac, guess what. I fixed it.

      You know why they can't fix their shit? Because it's practically magic to them. They have no idea how it works. How could they possibly fix it? So the end result of .net is basically the same as the end result of active X. It forces users to use IE. Oh sure, microsoft has made some magical control that implements ajax. I don't care. This is the 21st century. It is unacceptable to force people to use IE. It just does not fly with me.

    4. Re:Atlas by ThinkFr33ly · · Score: 1

      What are you talking about? It is no harder to develop applications that work cross-browser in ASP.NET than any other web development platform.

      Perhaps you need to encourage your university to get some new developers, because they're clueless.

      Stop blaming Microsoft when you should be firing those developers and getting ones with a clue.

    5. Re:Atlas by Anonymous Coward · · Score: 0

      Microsoft's entry into the suddenly-popular-even-though-it-has-been-around-fo r-7-or-more-years AJAX trend

      Holy fuck people. MICROSOFT INVENTED AJAX!!!

    6. Re:Atlas by CastrTroy · · Score: 1

      Developing cross browser apps is no harder in ASP.Net than in any other language. Unless you are doing stuff the microsoft way. Dragging and dropping controls, double clicking, filling in some code, dragging on some more controls. Dragging on a datatable control, creating a viewstate variable that exceeds the size of the rest of the page. The problem is, that with all this dragging and dropping, most of the people doing it have no idea what's going on under the hood, or what to do if something goes wrong. So, if it doesn't render or work properly in browser X, then the developer is pretty much screwed. However, if you have competent developers, who write their own code, to output their own HTML, then they will understand what is actually going on, and will be able to make it work reasonably well with all browsers.

      --

      Anthropic principle: We see the universe the way it is because if it were different we would not be here to see it.
    7. Re:Atlas by ThinkFr33ly · · Score: 2, Interesting

      Funny, because I both drag/drop controls AND understand what's going on under the hood. Why? Because I know what I'm doing.

      ASP.NET lets me develop web applications that are fast, cross platform, and extremely robust. When I encounter a cross-browser issue, I look at the HTML and I fix it.

      Blaming Microsoft when you should be blaming ignorant developers is plain stupid.

      Are you arguing that development tools and platforms should be inherently difficult to use so that the chance of a stupid developer getting anything done is minimal?

      Making a platform difficult to use results in even the smart developers getting less done. I would rather risk facilitating idiots than not giving the smart developers the best bang for their buck.

      ASP.NET is about a lot more than drag/drop. It's about creating an event-driven web development platform that comes just about as close as you can get to separating code from presentation. It's about making everything as object oriented and encapsulated as possible to both facilitate reuse and help maintainability. It's about providing an incredibly rich development platform that frees up developers to concentrate on features and business logic.

      I'll give you a simple example. I was tasked with exposing a large portion of an existing web site to mobile users. This site needed to be accessible by a wide variety of cell phones, PDAs, and other mobile devices. Normally, this task would be huge. I would have to detect virtually every model of phone and render things just a little differently.

      Thankfully, ASP.NET Mobile Controls do this for me. They have what amounts to a huge browsercaps file and the controls sense the requesting device and modify their output accordingly. I went from zero mobile support to supporting thousands of kinds of phones in about 3 days... and all of that 3 days was spent doing easy if not mundane things like figuring out the best flow for the mobile version of the site.

      On the other side of things, I've used ASP.NET to create applications that handle millions of requests a day. One application I recently finished mimics Google's AdSense technology. I can easily support over 1000 requests a second on a single Dell server with fairly modest hardware. (2.4 Ghz, 1 GB ram.)

      ASP.NET also has some awesome reliability features. I can make a change to a site and all existing requests are fullfilled using the previous version while all new requests are run on the updated version. This means not a single request is lost, even when deploying a new version of an application. I deal with applications that must have 100% availability... not a single request can get lost. Ever. Is this possible without ASP.NET? Sure! I could bring down a segment of my web farm at the load balancer, update that segment, bring it back online, and then move to the next segment... but that's a pain in the ass. And that's just one small example. There are hundreds more.

      So stop bashing something you obviously don't really understand. Go back to writing your web apps in PERL or PHP or JSP and enjoy it. You don't know what you're missing.

    8. Re:Atlas by CastrTroy · · Score: 1

      The problem with ASP.Net is that people believe they know what they are doing, even when they don't. It's good that you can go in and change the HTML so that everything looks good. But there are a lot of .Net developers who can't. Maybe I am getting mad at the developers who don't know what they're doing. Maybe it's nice that Microsoft makes everything really easy for us. But think about this. What would happen if you had to port one of your .Net apps to some other platform? What would you do? you'd have to completely redo the user interface. And all this stuff about seperating the code from the presentation? the code is the presentation. The code that runs results in the presentation. Layering code and seperating the data access from the business logic from the UI is important. But trying to completely separate all the code, from all the presentation is useless if what you want you're code to result in is the presentation.

      --

      Anthropic principle: We see the universe the way it is because if it were different we would not be here to see it.
    9. Re:Atlas by ThinkFr33ly · · Score: 3, Interesting

      So we shouldn't separate presentation from code because it makes it less portable? Actually, it often makes it MORE portable. My mobile web application is a great example. I was able to reuse a huge amount of code and target a VERY different client thanks to the fact my presentation and my code were extremely well separated.

      As far as portability in general... think about this. What would happen if you had to port one of your apps to Gameboy? What would YOU do!? What about my TI-86? Huh?

      Since I'm a developer who knows what they're doing, I know my target platforms before I start the project. If there is a chance I might need to port this to another platform in the future, then I take that in to account before I start the project.

      Crippling your application, or dramatically increasing development time, or being forced to choose a less than ideal development platform, because you want to make sure you can run it on another platform regardless of the business requirements right now is a bad idea.

      Sorry, but that VAST MAJORITY of web application will be created for one platform and stay on that platform for the foreseeable future. Applications that do require portability typically start off with that requirement from the get go. This is especially true for server side applications. (Which makes it all the more ironic that Java is so popular on the server side.)

      Nonetheless, there is Mono. They have made great progress. Is it perfect? Of course not. But neither is Java's portability.

      Lastly, you seem to view .NET developers as some kind of less educated developer. I'm not sure why. To some extent, I could see that with VB developers. They often started off with an MIS or IT background and had to use VB to solve simple problems. In fact, VB is great for that. VB evolved into a language that was great for a lot of things. But the stigma stuck around... with some justification. .NET developers live in a world that is far more advanced in nearly everyway than VB. We have all the great runtime features that the rest of the developer word has. I can write my .NET in C++, or one of several hundred other languages that can target the CLR. What, exactly, makes a .NET developer any less of a developer than somebody who chooses to toil away in PERL or Python or Java?

    10. Re:Atlas by The+Cydonian · · Score: 1
      Dont get me wrong, I am liking Atlas
      Haven't that bit of Ind-glish in a while. :-)
    11. Re:Atlas by Rycross · · Score: 1

      No, that isn't a problem with ASP.Net. Its a problem with the programmer.

      Do you honestly think that there aren't poorly written PHP pages? How about ones written in Java or Perl? I've seen plenty of crappy, non-cross-platform pages written in stuff other than .Net. Its not the fault of the language, just the developer.

      My group does .Net work, and besides some really bad legacy projects that we did not code originally, all our stuff is usable on the non-IE browsers and non-MS operating systems. And its rare that we ever have to tweak anything to work correctly; dragging and dropping works fine 95% of the time. The other 5% of the time, problems require only a little tweaking.

    12. Re:Atlas by CastrTroy · · Score: 1

      I'm not saying that there's anything that makes a .Net developer any less of a developer than someone who does Perl or Python or PHP or Java. I'm a .Net developer myself. What I'm saying is that by using the drag and drop features that MS provides you with, you are getting yourself stuck to using MS. If you ever wanted to port your application to run on PHP, or Java, then you would be very hard pressed to do that. Having all the UI programmed for you by dragging and dropping makes it harder to transfer the UI portion of that app to some other technology.

      Good programmers have always separated presentation from code. This is nothing new. The problem is that some of your code stil ends up resulting in presentation. Microsoft has now separated the code that controls the presentation from the actual presentation. What a great idea.

      --

      Anthropic principle: We see the universe the way it is because if it were different we would not be here to see it.
    13. Re:Atlas by CastrTroy · · Score: 1

      Yes, I guess the problem is with the programmer. However, the technology involved breeds developers who don't know what they're doing. I'm a .Net developer myself. However, I don't really use that drag and drop method too often. Maybe i'm just old school, and don't really want to learn a new way of doing something that I've been doing for years. Microsoft didn't really invent anything new. All they did was make it more necessary to separate presentation from code. But, in doing so, they have made it so that once you program an app using their method, it's almost impossible to move it to another technology. With PHP, or Java, or Perl, you can already run it on almost any OS that you'd want a web server to run on, but you can also port code between the languages. If you program something in .Net, you may be able to port some of the backend code, but try porting the interface to some other technology. You'll be hard pressed to get that to work with any other language.

      --

      Anthropic principle: We see the universe the way it is because if it were different we would not be here to see it.
    14. Re:Atlas by ThatDamnMurphyGuy · · Score: 1
      They have what amounts to a huge browsercaps file


      And this is the main thing that still bugs me about ASP.NET. Sniffing the user agent string is a failure waiting to happen. How often does that file get updated?

      I'm really happy about ASP.NET 2.0. It's got all of the good features of the object oriented web design, plus they paid more attention to having their controls spit out valid XHTML.

      P.S. Don't knock Perl. I do ASP.NET at work and Perl at home. THe more you know, the more perspective you have.
    15. Re:Atlas by ThatDamnMurphyGuy · · Score: 1
      Microsoft has now separated the code that controls the presentation from the actual presentation.


      Funy you should mention that. I was just griping this week about an apparent step backwards in 2.0 about that.

      In 1.1, when you drag a table to the page, it created a connection and data adapter. All the code for that was actually in the code behind; where it belonged.

      In 2.0, when you drage a table to the page, it creates a bloated doall called a datasource, and it tosses things like conneciton strings and sql command parameter definitions right in the html, in the asp: control tag. Holy wrong thing to do batman.

      Apparently this was brought on by some genuises decision to ditch the non-visual control area of the page designer and ditch the InitializeComponents part of the codebehind.

      Here's the bug report that pretty much sums it up.
    16. Re:Atlas by Jeff+Hornby · · Score: 1

      So you're implying that a Java/PHP application will compile natively in .NET. Let's get real here. Of course if you decide to change your development language there will be a lot of rewriting. That's why you decide on a development language when you start a project and don't change it.

      I've never seen a good business reason for moving a code base from one platform to another except in situations where the platform went away (software targetting BeOS, NeXT, various other platforms tat don't exist anymore). Unless you believe that Microsoft is gonig under soon, there's no reason to move .NET applicatinos to another platform.

      And the client platform doesn't matter. A properly built .NET application will run cross-browser. It takes a little more work but making apps work cross-browser in PHP is also extra work (N.B.:I haven't played with the Atlas libraries to see if they are cross-browser. If they aren't, I'll have to do some hacks to ensure that they will work with at least Firefox, Opera and Netscape seamlessly)

      --
      Why doesn't Slashdot ever get slashdotted?
    17. Re:Atlas by CastrTroy · · Score: 1

      There's lots of reasons you may want to move your application from .Net to something else. Maybe the cost of licensing windows is just getting too expensive. One or two small servers isn't too bad, but once you start building a web farm, using multiprocessor machines, that cost can skyrocket. Also, wanting to take advantage of 64 bit computing is easier with other platforms. .Net handles some pretty big loads. But if you want to do some really big loads, it's going to cost you a lot in licensing costs.

      --

      Anthropic principle: We see the universe the way it is because if it were different we would not be here to see it.
    18. Re:Atlas by ThinkFr33ly · · Score: 1

      The browsercaps file isn't updated enough for my taste, but it uses regular expressions and matches on general things like browser type (Openwave, etc.) so that it renders as best it can when it doesn't have an exact match.

      You can easily update this yourself, and there is a device profiler that allows you to easily add support for additional phones.

      Can you suggest a better way to do this? Mobile devices follow basically no standards and each have their own quirks. How do you suggest targeting these devices without a browsercaps file or database?

    19. Re:Atlas by ThatDamnMurphyGuy · · Score: 1

      Define "Target for mobile devices". Are we talking about functional differense in the site, or layout/look/feel differences?

      If the former, then I agree. You're stuck with teh best way to do it. If the latter, I'd say the look/feel/layout is seperated enough into CSS, but that's just me.

    20. Re:Atlas by ThinkFr33ly · · Score: 1

      Quantify your claims.

      Once you start handling millions of requests per day, bandwidth is your single largest reoccuring cost. The application that I build, and that runs on two Win2k3 machines (each of which cost about $4000, including the cost of Windows), costs about $50,000 a month in bandwidth costs.

      The cost of the license for Windows is almost never a big factor when you're talking about large scale applications. Small apps, like home-brew ones, are affected far more by these costs.

    21. Re:Atlas by CastrTroy · · Score: 1

      That really depends on the amount of power needed to handle a single request. There's some applications that require 2 machines to handle a million requests a day. There's other applications that require 10 machines to handle the same number of requests, because a request requires more processing. Maybe the amount of data sent out resulting from the request is low, but the amount of processing necessary to get that data is high.

      --

      Anthropic principle: We see the universe the way it is because if it were different we would not be here to see it.
  4. AJAX = OLD SCHOOL by ProVega · · Score: 0, Troll

    I have been using "AJAX" for almost 8 years now. Even back with IE4 you could use the XMLHTTP object to make "background" XML requests to the server, process the XML on the client and then modify the UI client side. Old hat. It is nice to see they finally have a name for it. Now maybe Microsoft will get rid of that crappy "server-side click" stuff and integrate this into .NET

    1. Re:AJAX = OLD SCHOOL by sexyrexy · · Score: 0

      Kudos. I created the first e-commerce site in Flash, before most people even knew what Flash was, and no one really gives a shit. Unfortunately, hitting one out of the park in terms of web development requires better PR than technical skills. With AJAX, it's simpy taken this long to become popular. At least we can be thankful that, now that it is popular, we're already ahead of the curve, eh?

      --

      Rex is 09 F9 11 02 9D 74 E3 5B D8 41 56 C5 63 56 88 C0
    2. Re:AJAX = OLD SCHOOL by uptoeleven · · Score: 1

      boo.com?

    3. Re:AJAX = OLD SCHOOL by Anonymous Coward · · Score: 0

      So Mr. Gore, how is your new website coming then?

  5. Pssha by DysenteryInTheRanks · · Score: 2, Funny

    Ya sorry but everyone knows that to obtain Buzzword Fad Certification (TM) AJAX *must* be coupled with Ruby on Rails, an Agile Development Model and legendary programmer Bill Brasky. Java does not fit in that picture (although apparently Brasky once coded a complete J2EE Web commerce framework in one hand on his BlackBerry while siring a child with his best friend's wife ... that framework launched a little site called Half.com).

  6. When you're using java, you can... by fireboy1919 · · Score: 3, Informative

    ...use JSON-RPC instead. XML is longer and hard for a javascript interpreter to interpret. Why does everyone want to use it as a wire protocol? I've never understood this. It makes a lot more sense to me to just store everything as a javascript hash.

    Anyway, unlike the almost most ajax libraries, which are at this point almost totally devoid of docs, the guy who wrote a JSON-RPC library actually tells you how to use it. If you've got java, its the way to go, I think. Here it is.

    Personally, I'm a perl monger, so I use this lib, which isn't nearly as good, as you have to do most of the javascript stuff yourself. Faster than XML though, and its still rather trivial to turn a DOM object into a plain javascript one for use with JSON.

    --
    Mod me down and I will become more powerful than you can possibly imagine!
    1. Re:When you're using java, you can... by daviddennis · · Score: 2, Insightful

      Okay, let me try to understand this. I'm putting together a brand spanking new web application that would greatly benefit from this technology. But to me, simplicity is the cardinal rule. Why do something in 50 steps, translating data from one langugage to another, when you can just keep it in one?

      I have over a decade of experience writing programs that spit out HTML. Why not have my Perl scripts spit out garden variety HTML which can then be substituted appropriately on the page?

      It seems to me that would be simple, clean and functional. And it might be a simple matter of saying my content type is text/html instead of application/xml.

      Why put the burden on JavaScript on the client, when I already know how to do it on the server? In terms of server processor time, it's just as easy to spit out HTML directly than it is to spit out XML and translate it to HTML on the other side.

      And if it is easy to do this, I'd appreciate a link to a tutorial.

      Many thanks for your time and ideas.

      D

    2. Re:When you're using java, you can... by uptoeleven · · Score: 2, Informative

      on the other hand the article as posted above goes into detail on degradability whereas JSON-RPC is specifically latest versions only. Of course the advantage of latest version use is that your machine is unlikely to be owned by one of the many nefarious sites out there just waiting to infiltrate and destroy you. On the other hand if your IT department is run by any one of the dolts I've seen managing IT departments, you won't have permission to update your browser and they won't bother.

      Still - got a version for php? :)

    3. Re:When you're using java, you can... by uptoeleven · · Score: 1

      I think it's more to do with the nature of the response. If you have a browser that is capable of dealing with an XML response (same as an HTML response without the page refresh) then all well and good. If you don't then your response will be ignored.

      You could feed vast amounts of HTML over the XML connection. Or you can just feed the relevant data and get the browser to reformat the page. The former is the old style of server-side coding. And sending through all those table and cell tags would be a nightmare in terms of server load. The latter is more elegant - you send what you need and only what you need. The ideal of course being pages that need only the minimum amount of refreshing.

      Unless of course I'm missing the point of your post which is entirely possible and for which I apologise in advance.

    4. Re:When you're using java, you can... by phallstrom · · Score: 1
    5. Re:When you're using java, you can... by daviddennis · · Score: 1

      Let's pretend things worked the way I thought.

      I would send a request and get a response from the server, as a character string.

      I could then do something like

      (html)
      <span id = "willchange">This will change</span>

      <td onclick = "changeit();"> ... </td>

      (js)

      function changeit()
      { /* send the request from ajax */ /* tell it to call receive_data when it gets something */
      } /* Call whenever data is received from the server */
      function receive_data(data_from_server)
      { /* make ajax request */
            document.all.willchange.innerHTML = data_from_server;
      }

      That seems a lot simpler than all this parsing, no? All I need to do is make the request, get the HTML back from the request and substitute it in the right spot. It should be dead easy ... right?

      Many thanks.

      D

    6. Re:When you're using java, you can... by Anonymous Coward · · Score: 0

      No - use CGI::Ajax and skip the whole js mess, if that's what you want. You can use CGI::Ajax to call perl functions from js (asynchronously). You can return a js object (e.g. created with JSON perl module) and eval it. CGI::Ajax is documented too.

    7. Re:When you're using java, you can... by uptoeleven · · Score: 1

      so you're tying the page architecture, the web app architecture and potentially the back-end architecture together. And then when you want to feed the same data to a different client (mobile phone, flash, RSS feed, tv, whatever) we have to write a new hook in the API. And when the design changes we have to rebuild the middle-ware.

      The point of XML is to allow us to simply send the data and let the client work out what the hell it wants to do with it. Of course it rarely works that way but AFAIK that's what's supposed to happen... or something...

    8. Re:When you're using java, you can... by LDoggg_ · · Score: 1

      Not to mention that the parsing is already done for you by the browser very quickly.
      You're just dealing with a newly retrieved Document Object Model that is painless to traverse in javascript.
      If bandwith is an issue, use a DTD/schema with small tags :)

      --

      "If they have both, tell them we use Linux. And if they have that, tell them the computers are down." -Dave Chapelle
    9. Re:When you're using java, you can... by Anonymous Coward · · Score: 2, Insightful

      XML is longer and hard for a javascript interpreter to interpret. Why does everyone want to use it as a wire protocol?

      XML might be hard for a Javascript interpreter to interpret, but you don't interpret the XML with Javascript. The XML parsing routines are built into the web browser itself, you just access it with the DOM, same as with all the other Javascript you write.

      Yes, that's marginally harder than having i as a native Javascript object, but it has the benefit of being reusable no matter what language you are using. If I also want to manipulate the data with a script, I can write that in any language, using standard XML APIs, not just one that can interpret Javascript.

      Given that the difference in effort between the two is so minimal, I prefer to use the more flexible approach.

    10. Re:When you're using java, you can... by uptoeleven · · Score: 2, Insightful

      OK I admit I have a vested interest in this. I wrote an API that did exactly this (custom strings) in IE4 & NN4. This is before IE5 came out and before I'd learned to read w3c specs properly. The API sucked more suckily than anything has ever sucked before. It was a multi-car pile-up of an API. I spent months writing this crap and nearly lost my job and those of my project manager and line manager over it. It was the code no-one else would touch, despite extensive documentation. I wrote this... thing, it used invisible frames or invisible iframes (no I didn't know what XML was supposed to do either), it was supposed to implement some sort of windowing system within a browser.

      Now picture this. A windowing system, to run in IE4 or Netscape 4 written by someone who doesn't know what they're doing. You want memory leaks? We had 'em. Most of the clients' machines would die after ten minutes running this. You want race conditions? Yup we those had those ose se e as we.
      ll
      This thing was so asynchronous it would frequently try to write to HTML elements that didn't exist yet... or that did exist but that the browser had decided they'd disappeared. Netscape 4 was the best at this. If a string was too long suddenly the rest of the dom disappeared into recursion hell and you couldn't drill down into the necessary layer.

      In the end I had to write JavaBeans to write the HTML which would then modify itself or not as the case may be...

      It was not merely a dog. It stank, whatever way you looked at it. Consequently the company never touched a DHTML project again and when they finally decided to upgrade the site they simply wrote a flat HTML version.

      I get flashbacks just thinking about it.

      But as a result I learnt that using a non-standard, custom server response may reduce project maintainability. And may reduce the likelihood of you keeping your job.

    11. Re:When you're using java, you can... by daviddennis · · Score: 1

      What I'm really trying to do is keep as much on the server as possible and minimize the use of JavaScript, which in my experience is a hideous swamp of incompatibilities. My mantra is to put as little on the client side as humanly possible.

      Among other things, this makes the mobile phone version easy. Instead of having AJAX refresh a table cell, I'll have it go to the server and pull the exact same HTML code I would have had in the cell.

      That sounds a lot easier to me than building two systems, one of which uses XML to talk to a "rich client" and the other which uses straight HTML for mobile phones.

      D

    12. Re:When you're using java, you can... by fireboy1919 · · Score: 1

      Converting XML into HTML requires the use of a XSLT document, and some funky browser facilities normally.

      Why not do it in straight HTML? Here's a few reasons not to:
      1) Repopulating elements you've already got with new data is faster than re-rendering part of the page. That's the whole reason why you're using AJAX at all instead of just using CGI.
      2) That can introduce memory leaks.
      3) Then you need html generating code on the server side. You can speed up development time if you're not worried about the wire protocol (it's just supposed to work without you fiddling with it - you just put the structures out there and it takes care of the conversion).
      4) You're not always generating elements. Sometimes you just want your page to change the way it behaves, and behaviours are generally written in javascript. So getting a new javascript variable is quite useful there.
      5) Remember, you need two way communication. Are you going to be using a DOM parser on the server to read the HTML that is spit out by the client? And isn't that even worse than XML as far as efficiency and reliability?

      It still seems to me that JSON-RPC is the way to go.

      --
      Mod me down and I will become more powerful than you can possibly imagine!
    13. Re:When you're using java, you can... by fireboy1919 · · Score: 1

      Well, if you're really concerned about it, the techniques used for degredation apply equally well to JSON-RPC.

      The real issue is why you'd use one over the other as a wire protocol.

      --
      Mod me down and I will become more powerful than you can possibly imagine!
    14. Re:When you're using java, you can... by daviddennis · · Score: 1

      What I want to do, essentially, is to change HTML within a page to whatever's generated by a server-side script. For example, let's say my application was a shopping cart.

      I want to replace the former value of the span called cart containing cart contents with, say, "Cart contents: Foo $53.95, Bar $25.75, Baz $32.95"

      So all I want is for my server-side script to output Cart contents: Foo $53.95, Bar $25.75, Baz $32.95 to the client, and have my client take that string and set cart's innerHTML property to it.

      I don't see the advantage of telling the server to give me the XML representation of that, sending it to the client, and having the client parse it and eventually come up with a innerHTML property for cart of Cart contents: Foo $53.95, Bar $25.75, Baz $32.95

      Because I'm a curious guy who wants to be open-minded, please tell me the advantage of the latter. It strikes me as about ten times more complex, and thus far more likely to run into memory leaks and other icky things than my idea. In addition, it's far more likely to run into compatibility problems on the client side, which are horrible to diagnose in my experience.

      Many thanks.

      D

    15. Re:When you're using java, you can... by uptoeleven · · Score: 1

      too slow. If you have a few thousand customers online concurrently, latencies for generating then feeding that amount of data on a regular (on average every second) basis are horrific. Forex & betting apps are impossible on that basis. Any bandwidth / latency sensitive application is out of the window.

      I used to do it the way you are suggesting. Not many clients took it up, not many were interested. A LOT of people are interested in AJAX which suggests that there may be some other advantage to assuming a smarter client.

      Plus with the pace of tech advancement, most clients are capable of manipulating a basic DOM.

    16. Re:When you're using java, you can... by daviddennis · · Score: 1

      You know, I'm not sure if I've explained my idea very clearly since it's the simplest and least bandwidth intensive method I can think of.

      This post:
      http://slashdot.org/comments.pl?sid=163110&cid=136 26407
      is my latest effort to perhaps be a little clearer.

      here's IBM's sample XML:

      <?xml version="1.0"?>
      <cart generated="1123969988414" total="$171.95">
          <item code="hat001">
              <name>Hat</name>
              <quantity>2</quantity>
          </item>
          <item code="cha001">
              <name>Chair</name>
              <quantity>1</quantity>
          </item>
          <item code="dog001">
              <name>Dog</name>
              <quantity>1</quantity>
          </item>
      </cart>

      Here's the HTML I would send back to the browser from my server side code:

      2 Hat, 1 Chair, 1 Dog

      That's many fewer characters than the XML.

      Now, it's true that if I loaded the entire catalogue into my browser, then it would be faster to put in an xml version of everything and be totally responsive once the catalogue was loaded. But then I wouldn't have to communicate with the server except for the final confirmation of the transaction. Unfortunately that kind of thing would be so slow to load (assuming a reasonably big catalogue) and so I doubt customers would prefer it. Also, cross-browser testing would be a throbbing migraine :-(.

      Thoughts?

      D

    17. Re:When you're using java, you can... by CastrTroy · · Score: 1

      I really think that this sending XML back and forth would be a real pain too. I'm kind of against this whole Ajax thing to begin with. Basically, all I trust a browser to be able to do, is to render HTML correctly, submit forms correctly, and follow links correctly. I'ved worked enough with Netscape 4, and all the other browsers out there, to know that putting that amount of extensive javascript in your application is just asking for trouble. Even if it works most of the time, there will be bugs in your code. Will you even know when those bugs happen. Someone clicks on something, you send back a pile of XML, and it never gets displayed for some reason. Or it gets displayed incorrectly, or only half of it get's displayed. Then they decide to click on something else, but the page is in some messed up state. And it gets even more messed up. At least with normal HTML you know what the state of the browser is after each update. With this new stuff, little pieces getting updated, maybe working on that browser, maybe not... you never really know.

      --

      Anthropic principle: We see the universe the way it is because if it were different we would not be here to see it.
    18. Re:When you're using java, you can... by vidarh · · Score: 1
      For one, by spitting out XML you can specify an XSL stylesheet or a CSS file and make it possible for browser to render contents directly - including when the user has javascript turned off. It's a great way to allow the site to gracefully degrade. Add to that an argument to your scripts to let the server side do the XSL processing and pass back HTML and you can trivially build lots of fancy AJAX functionality but have the site gracefully degrade for clients that can't or won't handle either javascript or XSL.

      You can also trivially make the API used for your AJAX interface available as an API for non-browser based applications to interface with your site - something that JSON isn't well suited for (I have lots of tools that can do stuff with XML in all the programming languages I know, I don't have any for JSON)

    19. Re:When you're using java, you can... by Jasin+Natael · · Score: 1
      I've done this. I have a lib (not ready to share yet) that takes an XML document and assimilates it into the current document as XHTML. There's a corresponding pair of objects in my PHP toolkit, XMLPage and XHTMLPage -- XHTMLPage extends XMLPage -- that I can use to return content in a full page, or atomically to the rewrite module, using the same subroutines.

      Here's what happens:
      (JS) Rewrite.load(url[, postdata[, callbackfn]]);
      (PHP) Create XML document:
      <?xml blah blah blah>
      <response>
        <rewrite id="divOne">
      ...XHTML Code...
        </rewrite>
        <delete id="divTwo" />
        <append id="Main">
      ...XHTML Code...
        </append>
        <javascript>alert('An Error Occurred!');</javascript>
      </response>
      The rewrite module then uses the XML DOM Tree to merge the response into the document. Each browser has to be handled differently, but the module is still only about 6-7kb. It keeps a queue to manage requests, so that there is never more than one active request.

      It works GREAT. If you're thinking of developing a similar toolkit, it's a good investment.

      --Jasin Natael
      --
      True science means that when you re-evaluate the evidence, you re-evaluate your faith.
    20. Re:When you're using java, you can... by jrumney · · Score: 1

      If you tag all your elements with id attributes, there is no reason why you couldn't have the XmlHttpRequest return just the elements that need to change, and have some javascript to alter the DOM based on what is returned. But you'll need an HTML parser in your javascript, since the javascript DOM API does not deal with HTML, it deals with DOM objects.

    21. Re:When you're using java, you can... by fireboy1919 · · Score: 2, Interesting

      No you can't. You have to use CGI and rerender the entire page if you're doing that.

      You might as well use html if you have to redo the whole page anyway.
      Repeat this to yourself until you remember:
      WIRE PROTOCOL! WIRE PROTOCOL! WIRE PROTOCOL!

      Its not for making a page! Its for moving data from server to client! Just data! Thats the whole point! And it requires javascript. Without javascript, you can forget all of it entirely.

      --
      Mod me down and I will become more powerful than you can possibly imagine!
    22. Re:When you're using java, you can... by Anonymous Coward · · Score: 0

      It's sad that Rasmus Leodorf, one of the main PHP developers, is so utterly clueless about Javascript.

      Don't use href="javascript:"

    23. Re:When you're using java, you can... by Anonymous Coward · · Score: 0

      I want to replace the former value of the span called cart containing cart contents with, say, "Cart contents: Foo $53.95, Bar $25.75, Baz $32.95"

      So all I want is for my server-side script to output Cart contents: Foo $53.95, Bar $25.75, Baz $32.95 to the client, and have my client take that string and set cart's innerHTML property to it.

      I don't see the advantage of telling the server to give me the XML representation of that, sending it to the client, and having the client parse it and eventually come up with a innerHTML property for cart of Cart contents: Foo $53.95, Bar $25.75, Baz $32.95

      What happens when you want to display a total as well? Parse the string into its constituent parts and then perform the calculation? Wasted effort. Include an additional string for the total? Quickly becomes unmanageable as complexity grows. What happens when you want to display the information as a table that you can sort by price? Again, you need the data, not just an unstructured string.

      Sure, you can use simple strings for the simple stuff, but then you are stuck using two different approaches because the simple strings don't cut it for the more complex stuff. There's no clear line when something is too complex for a simple string - what tends to happen is that you end up pushing the simple string far beyond its limits and write a bunch of code as a substitute for all the infrastructure that XML already provides.

    24. Re:When you're using java, you can... by daviddennis · · Score: 1

      I can just add the total to the one text field I'm sending. You'll always want it, so it will be right there. I wasn't thinking about that because my real application is not a shopping cart, and does not require ANY manipulation done to the data once it's in the browser. It just has to be slotted in the right place. I think the right place for manipulation is the /server/, not the browser.

      I'm not planning on creating something complex that needs to understand the data pushed to it. I'm trying to avoid that, you see. Remember, the other nice fellow who responded on this thread had huge, huge problems and created something with hideous complexity. I want to create something with wonderful simplicity.

      I'm investigating the solution proposed to me in one of my responses right now.

      D

    25. Re:When you're using java, you can... by daviddennis · · Score: 1

      I used to think exactly as you did. But we're not in the good old days of Netscape 4 anymore. In all modern browsers, we can, in fact, reliably change data within our web pages using the document.innerHTML property. I don't think there's any reason now not to use that to limit the amount of data we have to send, and give our users a better experience.

      The approach shown in the link I was sent as one of the first replies to my message looks pretty good and I'm going to be trying it over the next few days. If you (or anyone else) wants to drop me a line, I will share my experiences.

      D

    26. Re:When you're using java, you can... by uptoeleven · · Score: 1

      Thoughts?

      We're talking about completely different things. You're talking about sane server responses, I'm talking about coding on crack :)

      My issue is more to do with the nature of the meta-data. The more meta-data there is the more sensible XML becomes.

      So to begin with, yes, XML is bloat-tastic. In your example, clearly it is far more sensible to send back a straight list though probably with a little more data / meta-data in it.

      But if we're considering web apps and web services rather than a shopping cart the value of using XML increases. If we're writing a network monitoring tool where each node in the network could either be one machine or a sub-network, without meta-data the job becomes horrific. And there is so much meta-data that having an XML framework predefined means at least that's one less thing to worry about.

      Otherwise I have to start writing some mega-complex string handling procedures, make sure I set up a protocol I keep to (and document so everyone else keeps to it too - :D ). With XML that's already written.

      XML is usually overkill but when it isn't, it's very useful.

      You also bring up a very valid point with regards to bandwidth. Clearly if I want a real-time system that uses AJAX-like code, I'd need to optimise it so that the amount of XML being fed out was kept to a minimum. For a real-time stock feed update something like this would be the kind of thing:

      <?xml version="1.0"?>
      <upd gen="1123969988414">
              <it cd="DAVDEN">
                      <nuval>901.5</nuval>
              </it>
      </upd>

      So there you have a company code (clearly your company) and the new stock value and that's it, the client decides what to do with that data and where to put it. That wouldn't have much advantage over

      UPD:1123969988414:DAVDEN:901.5

      except that there's no need to write your own parser and it COULD be easier to migrate between platforms.

    27. Re:When you're using java, you can... by daviddennis · · Score: 1

      I think a lot of the time people make things over-complex because they feel they're elegant or beautiful. All I want to do is have a section of a page with HTML that I will swap for another block of HTML. In that case, using XML with all its complexity is just plain dumb. It happens that this is just a block of HTML and the only real action performed with it is to save or not to save changes, which of course requires contact with the server.

      I'm not doing a network monitoring tool, I'm not doing a dynamic stock quote display tool. Those things might benefit from a client program that actually understands what it's being told. My much simpler application does not.

      The reason I've been a bit strident and critical of the other methodology in this thread is that I think there are a lot of people who need simpler solutions than are often given, but it's much easier to find articles on a solution that's over-complex for 98% of all jobs. All too often, overcomplex solutions end up in the development horror you mentioned you had earlier with Netscape 4, although of course much of the problem was that Netscape 4 is just not suited for the task.

      I think we've reached agreement, then, that for what I'm doing, my solution is probably the best. I appreciate the time you've taken in responding to my various messages.

      Many thanks.

      D

  7. An "arrr" solution. by Anonymous Coward · · Score: 2, Interesting

    I much prefer a seaside solution.

    --
    The "are you a script" word for today is platform.

  8. I love how minimal the whole thing is by uptoeleven · · Score: 2, Funny

    almost as though there was nothing there. Except the concept...

    By the by, from the IBM site:

    > Server load
    >
    > Implementing an Ajax UI in place of a regular forms-based one may dramatically
    > increase the number of requests made to the server.

    Will be interesting to see how it responds to a slashdotting...

    1. Re:I love how minimal the whole thing is by temojen · · Score: 1

      Conversely, the requests that do come will usually have much smaller responses.

    2. Re:I love how minimal the whole thing is by uptoeleven · · Score: 2, Funny

      yes

  9. The problem with AJAX is the X by MarkEst1973 · · Score: 5, Interesting
    JSON is a much better mechanism for handling data transmission in AJAX applications.

    Why? Less verbose (easier on bandwidth) and no parsing (ever tried parsing XML using XmlHttpRequest? It sucks). JSON is object syntax. It is a real, live object serialized to string.

    It just so happens that JSON is also legal Python object notation.

    Hmmm... GMail, Google Maps, Google Suggest... none of these use XML. Google is also renowned for using Python. JSON syntax is the same in client-side javascript and server-side python... hmmm... makes me think twice, anyway, instead of drinking the web services kool-aid Sun and Microsoft are serving.

    1. Re:The problem with AJAX is the X by Anonymous Coward · · Score: 0

      instead of drinking the web services kool-aid Sun and Microsoft are serving

      I don't think you understand the point of web services. Don't worry, you're not alone there at all - seems like most people have absolutely no idea what they're for.

    2. Re:The problem with AJAX is the X by spid · · Score: 3, Insightful

      Not so. In both IE and Mozilla XML parsing is done in native code, and is pretty darn fast. Granted, accessing the nodes in that resultant document can be tedious from a development standpoint, but if it's performance you care about, then XML will most certainly be faster. While JSON may be more terse, and easier to deal with as a developer, the browser still ends up having to create a lot of objects in interpreted code, which is a lot slower.

    3. Re:The problem with AJAX is the X by The+Bungi · · Score: 2, Interesting
      For that matter you could use something like YAML and get over your problem with the "koolaid". If web services are useless from your POV that's fine, but some of us use XML for stuff other than doing OOB requests in JavaScript.

      You can move anything over HTTP, and as long as the receiving end understands you, you'll be OK. You can move INI files if you want. But some people prefer to use existing infrastructure (stable/tested parsers, WS-*, schema validation and so on) so as to avoid reinventing the wheel. Reinventing the wheel is expensive. So you take a small hit on the badwidth. Most people are not Google so they don't have to worry about measuring transport bandwidth overhead in terabytes and spending a year doing characterization testing.

    4. Re:The problem with AJAX is the X by Bob9113 · · Score: 1

      JSON is object syntax. It is a real, live object serialized to string.

      So it is a proxy, and when I call a method on the object, the behaviour occurs on the server side? I find that pretty hard to believe (or a very bad idea if it is true). Fine grained method calls were pretty much abandoned with the total failure of early EJB applications to scale gracefully (a lesson which had already been learned by many DCOM and CORBA programmers). I'm guessing that JSON actually uses serialized structs, possibly with identical associated methods on both sides of the wire.

      That is to say, a real live object has behavior associated with it, and state which is intrinsically linked to the environment in which the object resides. Early EJB apps extended that environment across the wire, with every method call traversing the network. It is extraordinarily hungry for bandwidth and completely unworkable on today's Internet (though it can work quite nicely in the lab or on purpose-built networks).

      Don't get me wrong, I'm not saying serialized structs are a bad thing. I love 'em, and use them every day. But objects they are not.

    5. Re:The problem with AJAX is the X by Sithgunner · · Score: 1

      It just sounds like ajax -> google web apps...

      Come on... where's our sourceforge cool web ajaxs?

    6. Re:The problem with AJAX is the X by Anm · · Score: 1

      And the parsing of javascript is also done in native code. The very fact that XML has a Javascript interface implies the browser "still ends up having to create a lot of objects in interpreted code". And the underlying design of DOM makes me think there will actually be more objects created through XML than through JSON. Remember, the JSON objects are almost all primitives in the Javascript language and there is a lot of optimization surrounding them.

      Anm

  10. DIGG! by Anonymous Coward · · Score: 0

    I don't know if anyone has noticed, but digg.com seems to be much better with the stories than slashdot. I saw this on there a day or two ago. No dupes either!

  11. Java? by MrArmyAnt · · Score: 0, Offtopic

    So what happens when a java applet is inside a java browser? Java in Java? That can't be efficient.

    1. Re:Java? by uptoeleven · · Score: 1

      I don't know of any java browsers off hand - most browsers are written in C/C++. Certainly those that will support a JVM will be as the JRE will be in C to allow it to run at a half decent speed. But theoretically, if you were running a browser, written in java, with a JVM, written in java, and you had an XML Socket open you'd be using Java rather than Javascript so you wouldn't be using AJAX anyway.

      Of course AJAX may allow some sites that insist on using Applets a method to reduce their dependency on client-side java.

    2. Re:Java? by Anonymous Coward · · Score: 0

      wtf are you talking about? AJAX uses Javascript, which is not Java.

    3. Re:Java? by Anonymous Coward · · Score: 0

      Your post makes no sense. Applets run on the client (browser), so you can't reduce client side Java by using applets.

      Yes most browsers are written in C/C++, which doesn't stop any of them from running a JVM.

  12. Ajax with lots of languages by Anonymous Coward · · Score: 2, Informative

    revolutionary or not, "AJAX" is now used in lots of languages. and there are some good tools out there. there's ruby on rails with the prototype library which is also now available in perl. there's also CGI::Ajax which is pretty simple to apply... and it's perl!

  13. Erlang and AJAX by CorruptMayor · · Score: 1, Interesting

    There's been an interesting discussion on the Erlang mailing list about a possible AJAX implementation. http://www.erlang.org/ml-archive/erlang-questions/ 200509/msg00282.html http://www.erlang.org/ml-archive/erlang-questions/ 200509/msg00320.html

  14. IBM comparison by Mostly+a+lurker · · Score: 2, Informative

    Also interesting on the IBM site is a comparison between the use of J2EE and Ruby on Rails, another great way of achieving Ajax functionality.

  15. AJAX Security by mrkitty · · Score: 1
    --
    Believe me, if I started murdering people, there would be none of you left.
  16. Better Java Apps with AJAX? by tjasond · · Score: 2, Interesting

    Why not just use Echo2 and not have to worry about the details of an AJAX implementation for Java? I generally prefer not to reinvent the wheel, and with all of the various browser quirks with respect to AJAX, that's quite a non-trivial wheel to try and recreate.

    1. Re:Better Java Apps with AJAX? by cbozic · · Score: 1

      Here's an application that already uses AJAX-enabled Echo2 if anyone wants to see it in action.

    2. Re:Better Java Apps with AJAX? by heffel · · Score: 1

      I second the motion to try Echo2. I wrote a couple of Echo2 reviews that can be seen

      here and here.

  17. XML is bloated-Carry a small package. by Anonymous Coward · · Score: 0

    "First off, I HATE XML. It's overly verbose and wastes tons of bandwidth."

    Shhhh! Don't anyone tell him about server-side compression/ Client-side decompression. He hates XML so much. You'd be wasting your breath.

  18. Re:XML is bloated by uptoeleven · · Score: 1

    Sure XML is bloated but the kind of XML a developer will want to come back to a web page is unlikely to be. What would it contain?

    Well obviously the data to go on the page. In addition to that, probably some meta-data to tell the browser where to put that data on the page. And that's it.

    The data coming back from the server is unlikely to be any more bloated than what would have been sent in a standard HTTP response, possibly less bloated - after all if you already have a page hierarchy set up there's no need to send another one down the tube.

    My gut feeling is that people will read these pages and decide whether or not AJAX is a "good thing" or not from what they read here, rather than RTFA. I'm not advocating censorship but I do think given the choice of forcing javascript developers to write an LDIF parser or getting them to use the built-in XML parsing capabilities, XML would win out for sheer convenience. Though watching them try to write an LDIF parser would be amusing...

  19. Interesting... by Spy+der+Mann · · Score: 1

    I do some parsing. But instead of XML, I use the HTTP-headers format.

    My-var1: Something
    My-var2: (Something_base64_encoded)

    Has been pretty useful for me.

  20. DWR and JSON by kevin_conaway · · Score: 0, Redundant

    Does anyone have any real world experience with either DWR or JSON? I'm curious to hear what others think.

    1. Re:DWR and JSON by gregduffy · · Score: 0, Informative

      DWR integrates integrates nicely with the Spring Framework (see this blog entry for an example), which is why I've been using it in my apps lately. Very cool stuff!

  21. Re:XML is bloated by museumpeace · · Score: 1

    While I would like to agree with you, and in terms of information density, XML is pretty fluffy if you go in for descriptive entity tags and all.....its more complicated than information density.
    I have written a few XML parsers and developed around Xerces and IBM xml/dom libraries and even written a parser generator code. What I eventually realized was that though the wires had to carry fatter messages, I had to write less code. Why? Regularity of the brutally simple grammar at the heart of XML and the hand-in-glove fit of nested structure and recursive languages means you can be very effective a developing and reusing XML handling objects. You won't notice this on your first project, maybe your second and for sure by the third one. Humans don't have to read the darn XML, programmers do. And we all know into which of those two species the preponderance of bill payers fall.

    --
    SLASHDOT: news for people who can't concentrate on work or have no life at all and got tired of yelling back at the TV.
  22. Ajax, Java, Echo2 by cbozic · · Score: 2, Interesting

    TrackIt is an application that takes advantage of all of the above technologies.

    1. Re:Ajax, Java, Echo2 by heffel · · Score: 1

      Trackit is a very interesting issue tracking software.

      I wrote a brief intro/howto article about Trackit that can be seen here.

  23. Ajax library for Java by strokerace · · Score: 3, Interesting

    There's a pretty good library I've used recently called DWR.

    If you're looking for a Java library to do some of the heavy lifting, check it out.

  24. For examples... by bad_outlook · · Score: 3, Informative

    Check out the new cal for Hula http://hula-project.org/Hula_Server - amazing work.

    And the front end to the webmail for Zimbra http://www.zimbra.com/

    Really, really nice stuff.

  25. Third camp sees this? by Anonymous Coward · · Score: 2, Insightful


    <head>
    <title>Ajax app</title>
    <script type="javascript" src="ajax.js">
    </head>
    <body onload="ajaxInit()">
    <noscript>
    We are very sorry but we, the developers of this website don't understand the web. We would like to provide a non-script alternative for the visually impaired, disabled and people with security smarts but "Ajax" is the future of the interweb and you are not. If you do happen to be visually impaired, disabled or security conscious then fuck off because we are too busy fapping to the latest buzzword to give a shit about you.
    </noscript>
    </body>
    </html>

    1. Re:Third camp sees this? by Anonymous Coward · · Score: 0

      I'll translate for non-luddites:

      "Wah wah wah wah wah wah wah wah wah."

      And I'm ACing for the luddites with mod points.

    2. Re:Third camp sees this? by CastrTroy · · Score: 2, Interesting

      I already get mad enough at developers that do everything in flash. God forbid I want to find out about the newest blockbuster movie without having my computer bogged down with tons of flash filled with impossible to find information. I don't see why everyone is out there to make the browser do more work then it really should. We have a hard enough time getting browsers to display HTML correctly. We don't even know what's going to happen with random browsers that are out there that may or may not interpret the JS correctly, or there may even be bugs in the code, causing something to not render correctly, giving users a really bad experience.

      --

      Anthropic principle: We see the universe the way it is because if it were different we would not be here to see it.
    3. Re:Third camp sees this? by Erik+Hensema · · Score: 1

      AJAX is a technique for updating a page with new information without a reload. The result is an updated page. Why would a visually impaired person be able to read a normal page but not an updated page? You do know there are javascript-enabled text-only browsers, do you?

      'security smarts' are irrelevant. Javascript can make your site more attractive. A more attractive site attracts more visitors. A javascript site loses some visitors. When you gain more visitors by using javascript than you lose visitors, you use javascript. Simple economics.

      --

      This is your sig. There are thousands more, but this one is yours.

    4. Re:Third camp sees this? by ThatDamnMurphyGuy · · Score: 1
      Why would a visually impaired person be able to read a normal page but not an updated page?
      All things in moderation. Keep in mind that Google is the worlds most popular blind web user. Whether real blind people will use your web app or not, you most certainly will want Google to still find it's way around to your content. Certain situations are or course the exceptions. Use AJAX where appropriate, and only AFTER the same functionality works without javascript enabled. This is especially true for anything related to forms.
    5. Re:Third camp sees this? by mdecarle · · Score: 1

      I actually know something about visual or physically impaired people and their websurfing. Most of these people actually use Windows / IE with Javascript disabled.

      The blind may be helped with a text-browser, this is true. And some already use these browsers. Don't forget that usually somebody else has to install those things.

      Otherwise impaired people still see. Why would you take their pretty pictures away from them while we/they can still see them? These are people that have difficulty moving their arms/hands, or have no arms/hands. They use joysticks, laser-pointer-like equipment or straws to move their mouse. Disabling Javascript enables them to use their input device in an less-controlled manner.

  26. Some preliminary exposure to AJAX by teutonic_leech · · Score: 0
    Well, as coincidence has it I'm currently using an AJAX style approach to implement new UI functionality for one of our corporate apps. The JavaScript can get a bit hairy at times but I expect there to be a growing library of taglibs, APIs, etc Besides the obvious UI experience (think gmail) I really like how AJAX has the potential to improve the quality of server side code. Servlets can now delivery small incremental parts of a page and the whole game becomes a lot more modular. Almost starts feeling like Swing development - well, maybe not really - LOL. I'd like to see improved support for event handling though - instead of passing the servlet/jsp name I'd like to be able to refer to a resource struts style and make my request that way. So, a particular JavaScript event handler would refer to a serve side resource by name. Yes, I'm doing this on my own right now but this should be a LOT easier a few months down the line.

    Anyway, yes I know this stuff has been around for years, but it's always been a bit hairy to implement and there were NO standards (kind of where ORM was before Hibernate and iBatis, etc.). This really could be more than a new 'fad' and allow developers to rapidly build dynamic apps based on common standards (think supportable, appliable, and extendable).

    Spellchecker? We do not need no stinkin' spellchecker!!!

  27. AJAX can be fun! by Klowner · · Score: 3, Interesting

    I made a little window-manager-esque thing in Javascript/CSS/HTML a few weeks ago (Looks messed up in IE, works fine in Firefox)

    http://dugnet.com/klown/ajwm/, all that's needed are some AJAX functions to swap out the contents of each window, instant freakish web-app thing..

    1. Re:AJAX can be fun! by whatever3003 · · Score: 1

      seems to work fine on Opera 8.02

      --
      "Those who do not want to imitate anything, produce nothing." -- Salvador Dali
  28. Re:XML is bloated by Zarf · · Score: 1

    If you don't like the XML in Ajax, try JSON (JavaScript Object Notation). With JSON you can implement Ajax without all the XML bloat. Ajax is more about the Asynchronous than it is about the XML. So Ajax without the XML and with JSON is... AJAJ?

    --
    [signature]
  29. Can't Colgate sue "someone" for using the AJAX by myfootsmells · · Score: 2, Informative

    brand name?

    1. Re:Can't Colgate sue "someone" for using the AJAX by spike2131 · · Score: 1

      Or maybe Homer should sue everyone for ripping off the Illiad

      --
      SpyDock: Scientific Python in a Docker container
    2. Re:Can't Colgate sue "someone" for using the AJAX by pbhj · · Score: 2, Insightful

      No.

      You're thinking, no doubt (?), of trademark law. Trademarks are technology specific. So unless "someone" is creating a cleaning solution and "passing off" that product as Colgates (?) Ajax ...

      Colgate could still sue. But they shouldn't win!

    3. Re:Can't Colgate sue "someone" for using the AJAX by beowulfshaeffer · · Score: 1

      Nope. Different market.

      --
      Shave the Whales!
  30. Remarkable omission by UhhhClem · · Score: 2, Informative

    Here we have a detailed, in-depth article about client-side browser XML processing that doesn't once mention XSLT. If you're writing JavaScript to transform your XML responses into updated client-side HTML by manipulating your browser's DOM, you probably should be listening to those who are recommending nonstandard-but-terse formats for data interchange.

    And while we're on the subject of terseness: complaints about "bloated" XML are meaningless outside of a context that takes the application's overall bandwidth requirements into account. Is an XML document bigger than a binary data stream? Sure. Is this significant? Depends on your application.

    1. Re:Remarkable omission by fireboy1919 · · Score: 2, Interesting

      complaints about "bloated" XML are meaningless outside of a context that takes the application's overall bandwidth requirements into account

      Totally untrue!
      There's also the issue of latency and local computation time. The less time between the click of a button, and the reciept of data, the better it is.

      The lower bound is very, very low, and every little bit helps.

      --
      Mod me down and I will become more powerful than you can possibly imagine!
    2. Re:Remarkable omission by UhhhClem · · Score: 1

      The lower bound is very low, true. The distance between that lower bound and what's perceivable by a user, however, is generally substantial. Of course it depends on the application. There are certainly some applications where engineering the data stream to minimize client-side parsing and transformation time will be perceivable, and where the payoff in responsiveness is worth the development cost of that engineering. The shopping-cart application in this article sure as hell isn't one of them, though.

  31. Re:Not reading IBM articles by yem · · Score: 1

    Maybe you should try again? There is no forced reg (I don't recall every seeing one in fact) and the content is very good IMO.

    --
    No, I did not read the f***ing article!
  32. Re:XML is bloated by KagatoLNX · · Score: 4, Informative

    First, Unicode under JSON is abit exciting. In XML there are no surprises.

    Secondly, XML is transported over HTTP 90% of the time.

    Almost all modern HTTP implementations implement GZIP as an encoding. If you don't already have this enabled in your servers, then you don't really care about bandwidth utilization.

    JSON offers nothing useful over XML+GZIP (which is a transport/encoding issue anyway). It can, however, make it vastly more difficult to interchange your data and tie you to a limited object model. If anything, I support the process used by the W3C. I like their standards. JSON is nice, but not nice enough. Sorry guys.

    Learn XML. Learn XPATH. Try to use Twisted's XMLSTREAM implementation for a taste of how easy and flexible it can be. Write some Jabber apps. JSON can't really be in those spaces. Not anytime soon at least.

    --
    I think Mauve has the most RAM. --PHB (Dilbert Comic)
  33. For the spanish by Anonymous Coward · · Score: 0

    It's not "aha"!!!

  34. JWP has a great AjaxTags component by fzammett · · Score: 3, Interesting

    Since everyone else is mentioning their favorite AJAX toolkit, I'll list one too:

    http://javawebparts.sourceforge.net/javadocs/index .html

    This is a component of the larger Java Web Parts project called AjaxTags. It's a taglib that allows you to easily add AJAX functionality to arbitrary page elements in a purely declarative manner, i.e., *NO* coding on your part (although there is more capability there if you need more). It really makes AJAX a breeze, and is pretty powerful at the same time. If you are a Java web developer, have a look, you may very much like what you see!

    P.S., The parent projects' page is here:

    http://javawebparts.sourceforge.net/

    --
    If a pion (n-) collides with a proton in the woods & noone is there to hear it, does lamdba decay into the source pa
  35. Re:XML is bloated by Anonymous Coward · · Score: 0

    You stupid asshole, if you hate xml then do this:

    <stuff>whatever_data_you_want_here</stuff>

    You really think that is going to take a long time to parse? You fucking idiot, you are too damned stupid to be a developer if you couldn't think your way out of that wet paper bag. I'm sick of you dumb shits pissing on every idea.

  36. ASP.Net and AJAX.Net MSDN article by Anonymous Coward · · Score: 0

    There's a recent article on MSDN that talks about Ajax on ASP.Net:
    http://msdn.microsoft.com/library/default.asp?url= /library/en-us/dnaspp/html/ASPNetSpicedAjax.asp

  37. AJAX AJAX AJAX!!! by alucinor · · Score: 0, Redundant

    AJAX!!1

    --
    random underscore blankspace at ya know hoo dot comedy.
  38. GZIP + JSON by alucinor · · Score: 1

    Now, that's even lighter and faster than GZIP+XML!

    --
    random underscore blankspace at ya know hoo dot comedy.
  39. DragNdrop between web pages by alucinor · · Score: 1

    When we can do that, we'll know this "Web 2.0" is really here finally.

    --
    random underscore blankspace at ya know hoo dot comedy.
    1. Re:DragNdrop between web pages by grimJester · · Score: 0

      I wouldn't be surprised if Microsoft is working hard on "browser integration into windows" so that the clueless user in the year 2008 will have no idea what the difference between his own computer and the Internet is. Then again, most of us have already seen a link to a picture on a message board pointing here...

  40. AJAX for PHP Developers by CaptainTux · · Score: 1

    Does anyone know of any AJAX toolkits targeted towards PHP developers? I am currently working on a project that could definately gain a lot from AJAX.

    --
    Anthony Papillion
    Advanced Data Concepts, Inc.
    "Quality Custom Software and IT Services"
    1. Re:AJAX for PHP Developers by doon · · Score: 3, Informative

      Cpaint

      I am using it now. seems to be working very well. has a Javascript library and both PHP and ASP backends. Can't talk to how the ASP side works, but the php side is very simple/straightforward.

      --
      To E-mail me, replace the first period in my domain with an @
    2. Re:AJAX for PHP Developers by blazin · · Score: 1

      I'm using SAJAX. It's super easy to use. SAJAX

      It's targetting PHP, Python, ASP, ColdFusion, Ruby, io and Lua.

  41. Japano AJAX Integration by fforw · · Score: 2, Insightful
    The article is surely a good entry to developing java webapplications with "AJAX" (Can't someone invent a better name?).

    For me (I am the author of japano, an MVC/JSP engine also containing dynamic javascript integration features), the following additional principles are were important:

    • Usability first. Don't use AJAX without a decent fallback. Don't use AJAX just because you can. Use semantic, standard-conform HTML/CSS layouts.
    • Use JSON instead of XML
    • Keep it simple. No object brokering or other fancy things. JSON transports data. Javascript requests and browser requests uses the same mechanisms.
    • Integrate. AJAX has quite some complexity overhead. Try to minimize that complexity by offering framework assistance. Japano offers two different AJAX mechanisms. Javascript views, and Partial updates.
    --
    while (!asleep()) sheep++
  42. Hermetic Sandbox by Doc+Ruby · · Score: 1

    Why does the Java applet security model require a browser user to set a value in their "Java Control Panel" (or other security policy equivalent), just to allow a browser to use URL class communications via a Proxy object that points at the server from which the applet was served? I'm talking about security exceptions on URLConnection.openConnection(Proxy). Stopping connections to any other host makes sense, because that could be a host within the client's firewall. But what's the point of stopping another connection to the applet's server, which could have sent whatever it wanted embedded in the applet itself? Requiring that manual security change discards the entire applet "zero install" convenience of software distribution. Which is Java's main benefit for client apps.

    This code:


    String getMIMEType(URL linkURL)
    { // Get the MIME type of the object at the URL.
        HttpURLConnection linkConnection;
        String contentType = "";

        SocketAddress addr = new InetSocketAddress("appletServer", 6666);
        Proxy proxy = new Proxy(Proxy.Type.HTTP, addr);
        try
        {
            linkConnection =
                ((HttpURLConnection)linkURL.openConnection(proxy)) ;
            System.out.println("lC: " + linkConnection.toString()
                + "; C-T: " + contentType);
            System.out.println("using proxy: " +
                linkConnection.usingProxy());
            contentType = linkConnection.getContentType();
        }
        catch (IOException e)
        {
            System.out.println("IO Exception: can't connect to "
                + linkURL.toString() + ": " + e.toString());
        }
    }


    just fails to report that it's using the Proxy. Because it isn't. What a pain.

    --

    --
    make install -not war

    1. Re:Hermetic Sandbox by Anonymous Coward · · Score: 0

      It's easy to setup a proxy that doesn't behave as a proxy should. Letting Java access any IP as a proxy is the same as letting it access any IP. You don't need to change settings to use the browser configured proxy, and that's as much power as Java should have in the browser.

    2. Re:Hermetic Sandbox by Doc+Ruby · · Score: 1

      What are you talking about? I specified only a proxy that is on the same host that served the applet. Which browsers won't allow connections to without the user changing the client security policy. I'm not talking about the proxy set in the browser's settings - that's different from the JVM settings, and would apply to every page, not just the applets. The JVM settings are bad enough - they apply to every applet, not just the one served from my server host. So each applet now has permission to connect to my server host, which is a risk to me. And configuring the browser is also a manual "installation" option.

      Meanwhile, the applet is allowed to make regular (nonproxy) connections to its server by default. So I set up a CGI that takes a URL as an argument, connects to that URL, and returns the remote object to the applet: a proxy. So I can get an applet to use a proxy with a lot more programming, less efficient (a webserver in the loop for each connection), and I can't reuse the lightweight, secure, manageable proxy servers that could just drop in with 15 minutes work. That security rule is superfluous, forces user installation work, and is a pain in the ass.

      Please know even the tiniest bit about the subject, perhaps just by reading and understanding my post, before you reply with Anonymous nonsense Coward replies.

      --

      --
      make install -not war

    3. Re:Hermetic Sandbox by Anonymous Coward · · Score: 0

      "zero install" convenience is not targetted towards those that are running a proxy on the same host as the applet, thank you.

    4. Re:Hermetic Sandbox by Doc+Ruby · · Score: 1

      Proxy on the same host as the applet was served from . That's entirely legit to connect to, as the applet came from there, and there's no increase in security. That allows, thereby demands, zero installation.

      --

      --
      make install -not war

  43. Re:XML is bloated by Anonymous Coward · · Score: 0

    AJAX beats JSON when the JavaScript standard includes a XML parser.

  44. What about Bindows? by zrh · · Score: 1

    Bindows (note the B) is a pretty cool framework for AJAX. It can be downloaded for free for educational/research purposes http://www.bindows.net./ For commercial it's $695. No, I don't work for them, and am not slashvertising. I haven't ever heard any mention of it on /. and wondered if people just don't know of it or don't like it. I'm writing a .NET backend (will be GPL eventually) for it that will make client-server more seamless. Automatic event hook-ups, state-syncs, etc.

    1. Re:What about Bindows? by zrh · · Score: 1

      Damn period got included in the URL. http://www.bindows.net/

  45. Which Ajax? by Anonymous Coward · · Score: 0

    The article doesn't say whether this is Telamonian (Great) or Oilean (Little) Ajax. D'oh!

  46. Erm, so this AJAX concept... by Elbowgeek · · Score: 1

    It seems that web geeks are so pleased with themselves that they can now have web applications which dynamically update, without having to redload the page.

    Now, I may be dim, but I understood that most computer applications could achieve this around thirty years ago??

    Doh!

    --
    Who is this delectable creature with an insatiable love of the dead?
    1. Re:Erm, so this AJAX concept... by Anonymous Coward · · Score: 0

      Yeah, but they could achieve it without relying on a Frankensteinian monstrosity of kludgy, clunky technologies that were stitched together inefficiently and inappropriately to inelegantly solve problems that don't exist. What fun is that?

  47. The Three Conditions of AJAX by Kamiza+Ikioi · · Score: 4, Informative

    "Its not just for XML and its not just a J language either... Ruby will do."

    No, XML isn't really a requirement of functionality. If by J you mean a Java backend, you are correct, but not if you mean Javascript Without Javascript you cannot have AJAX-like functionality unless you use a plugin or browser addon like JRE, Flash, etc.

    I just wanted to clarify this point to those who might take that statement the wrong way. Coding something in C++ that talks to a server is not AJAX, for instance. AJAX, imho, is defined by 3 characteristics.

    1. AJAX involves dynamic content, not static content. This means that there is a seemless interaction, without the application appearing to "reload".

    2. AJAX involves a stand alone web browser or an embeded web browser that is running the common scripting language Javascript.

    3. AJAX involves data retrival from a source outside of the client-side application itself, and does not solely use data embedded in the application itself.

    I could refine those a bit, but I think the general ideas come across. So, really, a Java applet embeded in your browser that talks to the server, such as an IRC chat client, is not AJAX, though it may provide AJAX-like functionality. The language of the backend is irrelevant; the data formats are irrelevant. The only relevance, really, is that you are taking something that has generally been static (web pages) and made the operate like a fully functioning application. It's the transition from "Information" (HTML) to "Application" (AJAX).

    The definition really can't go beyond this. If it isn't limitted to seemless dynamic content, you could call any webpage that contained Javascript AJAX. If it isn't limitted to browsers and Javascript, then you could call an SSH program, chat applet, multiplayer game XBOX game, etc. "AJAX clients". If it isn't limitted to outside data, then you'd have to call Javascript clocks AJAX. An application must (at least) satisfy these three conditions before it can be called AJAX. If it doesn't, it may still be a really good interactive and dynamic application, though not AJAX.

    The core of AJAX, XMLHttpRequest, is the only place I think the term XML is validated in the AJAX acronym. And, certainly, you can load any type of data you wish with it. If there was any single thing to define AJAX, it is this command. Without it (or something like it coded in a round about way... who knows, some people like the challenge) you cannot satisfy all 3 conditions.

    --
    I8-D
    1. Re:The Three Conditions of AJAX by Darren+Winsper · · Score: 1

      Hidden IFrames are the preferred method when XMLHttpRequest isn't available, IIRC. There's also the cunning trick of sticking a script element into the page, but I'm not sure how well that works and could cause all sorts of issues.

  48. practical uses by fishmonkey · · Score: 1

    I've used AJAX successfully on one corporate site, but for most of my sites I find the dynamic content looks cool, but is impractical as the user can't bookmark the results of their selection - or copy and paste the link to their friends.
    ie. google maps has to have the "Link to this page" hyperlink
    OK for them, not really ok for my fledgling sites.
    The best use I've found for it so far is loading data into select boxes, especially in linked select boxes when narrowing. That actually looks great.
    I really want to find a creative use for this tech in the future, I've been trying to innovate. eg. Interactive polls on the front page perhaps, real time comments... all without the page updating. A lot of possibilities, but of course I always have to try and make things useful to the client rather than using it as a way to show off.

    --
    generic
  49. Accessibility issues with AJAX by StandardsSchmandards · · Score: 2, Informative
    Before you jump on the AJAX bandwagon you should make sure you use it correctly. Using it correctly means augmenting your application with AJAX until assistve devices have caught up with AJAX/based apps.

    More on AJAX and accessibility can be found here: AJAX and Accessibility.

  50. Ajax app that searches log files by Alf+Gored · · Score: 1
    If you haven't see Splunk, it's a Linux/Solaris search server that uses Ajax. I can search on all my log files -- weblogic, apache, router logs, mysql, oracle, email, et cetera. Splunkboy

    //booyakasha

  51. Re:XML is bloated by mightyJohn · · Score: 1

    XPATH is barely cross browser (only through gigantic JavaScript libraries like Sarissa). JSON is useful because you don't have to parse it using a clunky JavaScript DOM interface. XML is great, but for my web apps, I appreciate the efficiency and simplicity of JSON.

  52. Re:XML is bloated by Anonymous Coward · · Score: 0

    You know what's human readable? LDIF.

    Can I pull information from LDIF with simple XPath expressions? Can I transform it into another format with XSLT? Does it use the DOM API I already have experience with? Can I style it with CSS?

    There's this thing called "the network effect". The more people use a standard format, the more valuable it is. XML might have a few minor downsides, but the fact that so many people use it means that the wealth of tools and software that works well with it is far more important than a few bytes shaved off here and there.

    it still feels like bloat. You ever look at a raw SOAP request?

    Congratulations, you've found one example of a bloated XML document type, and assumed that the same is true of every XML document type. That's simply not true. SOAPs a mess. XML in general isn't.

  53. DWR = Ajax made dead simple by fharper1961 · · Score: 1
    After doing some raw XMLHttp coding, I'm now using DWR http://getahead.ltd.uk/dwr/.

    So far it's been great. Very easy to add to add to a project, well documented, light-weight. It makes AJAX so easy.

    For testing and exploring, there's an interactive web page generated automatically by the servlet. From those pages you can see exactly which classes and methods you have access to! From there you can even call your server side methods interactively. Look ma no code!

    --
    http://frank@franklinharper.com/
  54. I don't get it by Pragmatix · · Score: 1
    I don't get it, I looked into 'AJAX' to implement part of a context sensitive help system I am working on for a web-application and there was nothing to it. How can all this stuff be written about something so simple? Am I missing something?
    function GetHelpPage(helpid)
    {
    if(!helpid) return;

    if (document.all)
    xhttp = new ActiveXObject("Msxml2.XMLHTTP");
    else
    xhttp = new XMLHttpRequest();
    xhttp.onreadystatechange = HandlerOnReadyStateChange;
    xhttp.open("GET", "http://localhost/ipool/HelpXML.aspx?helpid=" + helpid, false);
    xhttp.send();
    }

    function HandlerOnReadyStateChange()
    {
    if (xhttp.readyState==4)
    {
    var x = '';
    var nodes = xhttp.responseXML.selectNodes("//helptext");
    for (var i=0; i<nodes.length; i++) x += nodes(i).text;
    LaunchHelpWindow(x)
    }
    }
  55. DWR makes Ajax with Java dead simple by fharper1961 · · Score: 1
    After doing some some stuff in raw XMLHttp, I'm now using DWR http://getahead.ltd.uk/dwr/ [getahead.ltd.uk].

    So far it's been great.

    DWR is very easy to add to add to a project, well documented, and light-weight. It makes AJAX so easy because javascript stubs are generated automatically for the Java classes you decide to export.

    For testing and exploring, DWR creates an interactive web page generated automatically by the DWR servlet. From those pages you can see exactly which classes and methods you have access to and the number of parameters required! From there you can even call your server side methods interactively.

    Look ma no code!

    --
    http://frank@franklinharper.com/
    1. Re:DWR makes Ajax with Java dead simple by dteare · · Score: 1

      +1. DWR is amazing. If you are forced to use Java, it is the way to go. At the risk of slashvertising, here is an article I wrote about using DWR: http://dev2dev.bea.com/pub/a/2005/08/ajax_introduc tion.html

  56. distrubting by Anonymous Coward · · Score: 0

    What's "distrubting" to me is your peculiar spelling...

  57. Auto Refresh? by perdu · · Score: 1

    Is there a way in Java script, or another implementation of this technique, that will trigger an update after a given time interval? OK, I can look this up myself (and will), but was wondering if anyone has done this to create a live page.

    --
    You only use 2% of your DNA
    1. Re:Auto Refresh? by netcrusher88 · · Score: 1

      Google has. Hang around on the gmail page for a while. I think ~2 min. And you can get their code - there's a whole lot of it, but just follow the script src from the main gmail view.

      --
      There's an old saying that says pretty much whatever you want it to.
  58. Along those lines... by Kamiza+Ikioi · · Score: 1

    The simplest trick I remember was to use the innerhtml property of hidden divs, and write var data there, and then use a timer in the JS to load it up.

    I still use that trick as it's a good replacement for session cookies when you really don't want to code a any backend scripts or mess with cookies for some little "play page".

    --
    I8-D
  59. Good article - sorely needed by mattma · · Score: 1

    Ajax is a fine integration platform. We here at Lightspoke have adopted this framework for our own web-based database. Since then scores of customers have used this capability to extend our database to their existing web sites. We spent a lot of time figuring out the performance aspects - a sort of Ajax for the real world if you will. We need more articles on using Ajax in real settings - best practices, case studies, lessons learned. Integration is the key to eeking ever last but of value out from our existing technology investments. I believe our customers would be the first to agree to that.