Follow Slashdot stories on Twitter

 



Forgot your password?
typodupeerror
×
Programming IT Technology

AJAX Buzzword Reinvigorates Javascript 541

samuel4242 writes "Javascript may have been with us since the beginning of the browser, but it's going through a renaissance as companies like Google create Javascript-enabled tools like Google Maps . There's even a nice, newly coined acronym , AJAX for "Asynchronous Javascript and XML". A nice survey article from Infoworld interviews Javascript creator, Brendan Eich, who says that this is what he and Marc Andreessen planned from the beginning. Perhaps AJAX will finally deliver what Java promised. Perhaps it will really provide a solid way to distribute software seamlessly."
This discussion has been archived. No new comments can be posted.

AJAX Buzzword Reinvigorates Javascript

Comments Filter:
  • by Anonymous Coward on Tuesday May 24, 2005 @12:22PM (#12624371)
    urrrrrrrrr.....
  • Rewriting history? (Score:5, Informative)

    by Anonymous Coward on Tuesday May 24, 2005 @12:22PM (#12624372)
    Javascript may have been with us since the beginning of the browser...

    Huh? I don't seem to remember seeing it until about '96 or '97. That's just a wee bit later than the beginning of the browser...
  • by KillerDeathRobot ( 818062 ) on Tuesday May 24, 2005 @12:24PM (#12624397) Homepage
    If I recall it was created for Netscape 3. So definitely not the beginning of the browser.
  • by mortonda ( 5175 ) on Tuesday May 24, 2005 @12:26PM (#12624409)
    Ruby on Rails [rubyonrails.com] has been working on this for some time, at least since the 0.11 release [rubyonrails.com] back in March. This is a wonderful technique for speeding up web applications. Browse around the web site, or hang out in IRC, and you will quickly see what all the excitement is all about.
  • by yagu ( 721525 ) <yayagu@@@gmail...com> on Tuesday May 24, 2005 @12:27PM (#12624425) Journal

    For me, the crux of the usefulness and eventual adoption and finally complete embracing of AJAX lies in the article's paragraph:

    Some of the buzz surrounding AJAX has been generated by Web designers as well as programmers. AJAX?s flexibility is invigorating for Web designers because JavaScript can control any aspect of any images or type on a page. Fonts can grow or shrink. Tables can add or lose lines. Colors can change. Although none of these capabilities are new to programmers accustomed to building client applications -- or, for that matter, Java applets -- they are novelties to Web designers who would otherwise be forced to rely on Macromedia (Profile, Products, Articles) Flash.

    I've seen what Google has done with AJAX (e.g., Google suggest), and it's stuff I never imagined could be so repsonsive in a web context. For me it starts to make programming fun again, and web programming an acceptable form of application development.

    When browsers and web first emerged I could see the writing on the wall, but I wasn't happy about it. Browser application writing from the programming perspective was probably the single most giant leap backwards in technology for me (not including technologies introduced by Microsoft)....: you mean, all the years I've spent honing skills writing applications no longer apply? You mean I no longer have "state" as a tool for maintaining sanity in my application???? Hwaahhh??? I have to do what to change the web page???

    While there have been some technologies (ASP, JSP, etc) to help with these issues, none have addressed the responsiveness issue with the web page round trip message loop. AJAX comes close. Now all I have to do is learn it.

    For a great example of the responsive nature of this (I've referenced this before), go to Google Personal Home [google.com], set up your own home page, and play... Configure your modules by dragging them around... open and close your g-mail previews. This all starts looking alot like programs actually running locally on your own machine. (I'm assuming all are familiar with and have played similarly with Google Maps [google.com].)

    Additionally, here are some very good resources to learn more about AJAX:

    That's it, I'm done.

  • by Anonymous Coward on Tuesday May 24, 2005 @12:29PM (#12624447)
    Nobody here said it did! They said it might be able to deliver what Java promised. NO MENTION of Java and Javascript being the same there. If I say I might be able to deliver what Jane promised, I'm not saying I'm Jane, am I? They're refering to run-anywhere.
  • by costas ( 38724 ) on Tuesday May 24, 2005 @12:29PM (#12624455) Homepage
    Hm, Ajax as these guys mean it, is centered around XmlHttpRequest which IE (6, I think) introduced first (meaning it was a non-standard API). Mozilla actually copied MS, which then made XmlHttpRequest "cool" and we now have this Ajax buzzword business. Never mind that there have been libraries [ashleyit.com] that have been enabling asynchronous DOMServer communication for much longer than Google Maps or GMail...
  • by Vraylle ( 610820 ) on Tuesday May 24, 2005 @12:30PM (#12624465) Homepage
    The current iteration of our AJAX library handles IE, Moz, and Opera. While there are browser checks, they're not overly cumbersome.

    It works beautifully in all three.
  • Re:Slower than Java (Score:2, Informative)

    by Anonymous Coward on Tuesday May 24, 2005 @12:32PM (#12624492)
    You don't have to do that. Just add a little more data in the initial page load and make the browser do all the work. Once you reach a milestone, then post back to the server. You have to add some server-side validation to keep the script-kiddies at bay, but the performance cost of that is negligible. Also, if you do have to trip back to the server for data, its a lot quicker to just return the data that you need rather than refreshing the whole page.
  • by md17 ( 68506 ) <`gro.drawsemaj' `ta' `semaj'> on Tuesday May 24, 2005 @12:40PM (#12624585) Homepage
    This is why people are building component frameworks around AJAX. Component frameworks hide the messy browser specific details. This gives a developer who uses these components "one programming language" that works universally and provides a RIA experience.

    AJAX's fate does not rest on all browsers being in full compliance to the standards, it rests more on the implementation of AJAX components. You can read more about my view on this on my blog [64.233.167.104].
  • by PerlDudeXL ( 456021 ) <jens...luedicke@@@gmail...com> on Tuesday May 24, 2005 @12:43PM (#12624614) Homepage
    Correct me if I'm wrong, but Ruby on Rails is server based and AJAX is browser based and I see no way to compare those concepts!?

  • by bhirsch ( 785803 ) on Tuesday May 24, 2005 @12:45PM (#12624651) Homepage
    Nope. It made its debut in Netscape 2, along with Java applets. The big hype was the ability for the two to interact, but it never really seemed to happen.
  • by Anonymous Coward on Tuesday May 24, 2005 @12:48PM (#12624673)
    Actually it appears JavaScript debuted [netscape.com] in Netscape 2.0. (Link via this [sillydog.org].)
  • Re:widget set (Score:4, Informative)

    by los furtive ( 232491 ) <<ChrisLamothe> <at> <gmail.com>> on Tuesday May 24, 2005 @12:54PM (#12624734) Homepage
    Try domapi [domapi.com], it has a very polished set of JavaScript widgets and version 4 is currently in beta.
  • Ajax mistakes (Score:5, Informative)

    by afd8856 ( 700296 ) on Tuesday May 24, 2005 @12:55PM (#12624749) Homepage
    Just today I was looking at this page [sourcelabs.com] It's a list of ten easy to do mistakes in Ajax apps. Some of them are not that easy to avoid...
  • Re:Java (Score:3, Informative)

    by poot_rootbeer ( 188613 ) on Tuesday May 24, 2005 @12:57PM (#12624786)
    So quit calling Java dead :)

    Okay, fine.

    Java applets embedded in webpages are dead.

    But on the other hand, J2EE is heading towards becoming the de facto standard language for server-side web development, as is J2ME for handheld development.

    On the whole, Java is alive and well.
  • by ad0gg ( 594412 ) on Tuesday May 24, 2005 @12:57PM (#12624788)
    Its been out since IE 5.0 which was released in 2001. I've seen intranet apps use it all the time. Hell quick search, revealed old articles [15seconds.com] on the subject. I don't get how a 4 year old technology becomes new by simply giving it a stupid name. I even love how the article fails to mention that its been around for 4 years. And i love how the grand parent gets modded flamebait by merely pointing out that it was a Microsoft invention.
  • Re:Javascript? (Score:5, Informative)

    by telbij ( 465356 ) on Tuesday May 24, 2005 @12:57PM (#12624792)
    Quite honestly javascript is a very poor language.

    Actually, Javascript is surprisingly robust. Probably you're referring the platform inconsistencies, which have long been a showstopper. But with recent versions of browsers supporting the javascript standard (ie. ECMAScript) increasingly well, a lot of the major wholes are closing, and you really can write cross-platform javascript with a minimal compatibility layer.

    Javascript is not meant to be a large-scale programming language... it doesn't have strong-typing or other features that you want when developing million-line applications. However, it is still an extremely powerful language providing things like full object-orientation (everything is secretly descended from the window object), comprehensive hooks to HTML, functions as data, regular expressions, flexible data access (eg. objects as hashes), and robust event handling.

    I used to think of javascript as a toy language, but when you get to down to it, it does what it needs to do very cleanly and efficiently without imposing unnecessary overhead on the programmer.

  • by mortonda ( 5175 ) on Tuesday May 24, 2005 @12:59PM (#12624817)
    True, RoR is server based, but AJAX requires an interaction between both client and server. RoR includes a javascript component called Prototype, which helps handle the client side of things. In addition, RoR includes many helper functions that help you write the appropriate javascript functions, without needing to know much javascript.
  • It's quite possible to build powerful crossplatform applications for the web now - in Flash, Java or AJAX.

    One way is AJAX. To make it work well, you essentially have to write a version of the page for each major browser - which is a lot of work. Of course, there are development tools that make this substantially easier. It is by far the most seamlessly integrated with the BROWSING experience, but is less suited than Flash or Java for real applications - like a game or any other datadriven mouse-interactive thing. I don't believe there is no OOP Javascript in a browser.

    Another way is Java applets. Java has the advantage that lots of programmers learn it to do nonapplet Java work. The big disadvantage is that a big part of the installed userbase has broken M$ Java engines, and it's generally impossible to install a Java engine without computer-admin privs (as opposed to "browser admin" privs)

    The final way is Flash MX 2004 or Flex. Like Java applets, it is a fully featured OOP programming language (Actionscript) It expects to deal with server information, and can innately request data from mostly-arbitrary SOAP Web Services. It also works innately on OSX, Windows and i386 Linux in most all browsers and on a variety of small devices. It doesn't work on more obscure platforms, however, and it's not OSS so it can't be ported by just anybody.

    Summary: If you want to a supercharged browser experience, use AJAX. If you want an application that "just happens" to be projected over the web, use Flash.
  • by wootest ( 694923 ) on Tuesday May 24, 2005 @01:46PM (#12625334)
    I do believe Microsoft was the moron that made the onreadystatechange event handler, along with the rest of the XMLHTTPRequest object.
  • by brundlefly ( 189430 ) on Tuesday May 24, 2005 @02:05PM (#12625536)
    JavaScript first arrived in Netscape 2. In that browser most of the core language was in place, making it one of the first ever prototype-based OO languages to go from concept to reality.

    But in Netscape 2, there were not very many hooks from JavaScript back into the HTML. You had a document object and a window object of course, but beyond that about the only "DHTML" you could do was mostly restricted to manipulating form values and popping open new windows. Useful, to be sure, but that was about it.

    In Netscape 3 they added the document.images array, and that began the whole image-swapping madness that got everyone hooked on JavaScript, for better or worse.

    And then in NS4/MSIE4 they added the competing, incompatible DOMs that got us into the hell years of DHTML. DHTML as a term arrived with the version 4 browsers.

    Give JavaScript some credit for surviving its own history... the language has been through some very rough years, only to now finally get some credit for being a powerful web tool.
  • by snorklewacker ( 836663 ) on Tuesday May 24, 2005 @03:13PM (#12626299)
    The Konfabulator site needs more categorization. If I took out all the clocks, countdown timers, single-purpose RSS readers, and webcams, there'd be like six widgets left. I've never seen so much useless junk in my life. Well I suppose I have actually, but not in this particular fashion.

  • by Anonymous Coward on Tuesday May 24, 2005 @03:14PM (#12626308)
    Try...Catch [devguru.com]
  • by Jellybob ( 597204 ) on Tuesday May 24, 2005 @03:55PM (#12626733) Journal
    The thing your missing is Prototype [conio.net] - a Javascript library which attempts (most successfully) to provide cross-platform objects to access common issues.

    It's worth the price just for the $() function, which does a document.getElementById() on the argument ;)
  • by nahdude812 ( 88157 ) on Tuesday May 24, 2005 @04:11PM (#12626936) Homepage
    Oh, and getting all the Slashdot pundits on their soap boxes, preaching about technologies they don't really understand, and making dire predictions about the unworthiness of the tech.

    Seriously, being someone who actually has quite a bit of *real* experience with Ajax (though we were doing it before the term was coined) across multiple browsers, I can say that the ratio of comments which demonstrate the author understands the full implications of Ajax to those who are just spouting nonsense is about 1:75. I've never read an article on Slashdot before where so many comments missed the target, and I feel like I've been around Slashdot for a little while.

    The idea behind Ajax *does* revolutionize the web paradigm. All this nonsense about cross browser compatability issues is just that: nonsense; it works in Mozilla, Firefox, IE, Opera, and Konqueror each on their respective available platforms. I've actually heard people talking about "Ajax enabled advertisements instead of Flash." Other gems like "Ajax doesn't do anything that a well programmed web application can't do," and "It's just needlessly complex web pages" only point to users who fail to grasp the fundamental concept.

    Let me tell you: Ajax is FAST. You don't realize how unresponsive web pages are until you get to play with a web app that is always waiting on you, no the other way around. When I submit information, why do I need to wait for that information to get to the server before I can begin to perform another operation if that operation isn't dependant on the previous? Click Add To Cart then *immediately* start searching for the next item. Stuff like that.

    The amount of data being exchanged is far less (if you do it RIGHT, you people who are talking about using the XMLHttpRequest.responseText property, this does NOT include you). Rather than reload an entire page with all the framework, you're loading only the portion of the page that changed.

    Aside from piecemeal page loading, you also get to load only the relevant data. For example, rather than load a form, and all the form formatting to make the text fields line up correctly, and all the validation code to validate that form, you load a series of XML tags that contain only the basic information needed to tell the client how to lay out the form. The client takes care of generating the HTML for the form, and your form data looks more like this:
    <input name="username" label="User Name" required="yes" minlength="5" maxlength="10"/>
    versus
    <tr class="lightRow"><td class="labelColumn"><label for="username">User Name:</label></td><td class="inputColumn"><input id="username" name="username" maxlength="10"></td></tr>
    , then later form validation code.

    Often times your data fits inside a single TCP packet.

    I'll make this concession: yes, this is stuff that could be done before the Ajax philosophy using Flash or Java Applets. But both require a plugin, and one of them is even proprietary. Both have potential firewall issues, and neither will run on a vanilla Fedora Core build. Both require higher resource consumption for the user, and both lend to a feeling of sluggishness on the site for the user.

    That's not to say that it's not without its dangers. Like all web apps, you can't trust the data from the client. Here the client gets a bit lower level access to the data. You still have to make sure that you're protecting yourself well against data poisoning attacks.

    The thing I like most about this model though is this: It's truly a MVC (Model View Controller) framework.

    The model is of course your server side logic scripts. The View is the browser (the server side logic scripts send back generically formatted data, the browser does all the display). The Controller is the combination of XMLHttpRequest object, and the processing management script on the server. It's very conceivable that you could write a new front end for your application by simply
  • by AstroDrabb ( 534369 ) * on Tuesday May 24, 2005 @09:27PM (#12629923)
    Huh? Why don't you look for a real DOM ref? That one is not standards compliant. So if you only care about crappy IE, you are OK, otherwise, you will get a bunch of crap.

    For example, click on the first link [microsoft.com] in your example. It takes you to "DHTML Collections". It lists "all" as a collection. "all" is not a DOM collection. It is MS specific crap that break compatibility between browsers and makes your web app only work in IE.

    Here is a _real_ DOM reference [mozilla.org]. This one is standards compliant and will work with the major browsers out there.

  • by elbobo ( 28495 ) on Wednesday May 25, 2005 @01:26AM (#12631287)
    Sounds like you've just made your application dependent upon Javascript. That's not good practice

    Don't be ridiculous. Web Applications must depend upon a client side programming language. Web pages need not depend on a client side programming language. Applications have specific target platforms and requirements. Pages however are expected to be at least viewable on a much broader range of browser platforms.

    Me thinks you're out of your depth.
  • by nahdude812 ( 88157 ) on Wednesday May 25, 2005 @09:25AM (#12633361) Homepage
    I wish I had one, perhaps I should actually *write* one. We figured out most of the Ajax methodology ourselves, as I mentioned we were doing this stuff before Gmail & the term "Ajax" came along.

    The basic overview is that you have various
    's on your page with ID attributes. You create a wrapper function (eg, ajax(function,arguments,onReturn)) which makes a call with the XMLHttpRequest object back to your server, passing the function and arguments. On the server, the function does its processing (you need to make SURE that only functions you expect to be called directly by users can be called through this script). The server side function gets its results ready and hands them back to the server side Ajax script, which formats it as XML and sends it back. Back on the client end, the onReturn code executes across the result data, creating HTML out of the XML being sent, and putting this HTML into the appropriate
    on the page.

    Only the portion of the page that needs to change actually changes, the user never reloads anything else. Because this happens asynchronously, multiple operations can happen in parallel and the user can continue to interact with the rest of the page while their operation performs in the background.

    Imagine looking at a product listing on an ecommerce site. You can click "Add To Cart" next to each item on the page in rapid succession. You don't have to wait for each adding to successfully register, you click "Add" and it immediately appears in the shopping cart, with perhaps an indicator that the add is still taking place (italicise the text of the product name, for example, and unitalicize it when the add is done).

    The reason why it's a paradigm shift is that this makes the web page behave much more like a desktop application, but it can be more responsive than some desktop apps I've seen which are not capable of parallel operations like this (while processing an action, no further actions can happen). The web developer works only with individual page parts, and they don't have to worry about what else should be displayed on the page. You've already sent data to the client about the user's personal information (login name, view preferences, and such), there's no need to re-send this the next time the user clicks on a link. You get to preserve the state of previous page hits.

    There's no longer a model of pages, it's a functional model. Individual layouts happen as a page hit, everything else is a function call. That function returns raw data and the client lays it out. All formatting is client side, and this combined with the fact that you're only building the portions of pages that changed leads to greatly reduced server loads.

    But most importantly of all, the user never ever waits on the server to respond unless they either need confirmation that the operation has happened, or they are depending on the results of that response for their next operation (eg, when you do a search for a given product, you have to wait for the server to give you that product listing before you can add it to your cart).
  • by elbobo ( 28495 ) on Wednesday May 25, 2005 @10:57AM (#12634457)
    I also have been writing web applications for five or more years. Client side scripting is more and more an integral part. The lack of it makes them just web pages with some "application" application, like Slashdot for example.

    When you talk about "the web" being the platform, you're not talking about applications, you're talking about web pages with application-like usage patterns.

    Only a fraction of applications built with the browser as the platform require that the most absolute cross-platform "everyone" be able to use them without out of the box.

Credit ... is the only enduring testimonial to man's confidence in man. -- James Blish

Working...