Better Web Apps With Ajax 184
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."
With AJAX, you know you've got (Score:3, Funny)
Re:With AJAX, you know you've got (Score:3, Funny)
Re:With AJAX, you know you've got (Score:2, Funny)
hrm - on a white background, that's not goin' to work so well...
Re:With AJAX, you know you've got (Score:5, Funny)
I love how minimal the whole thing is (Score:2, Funny)
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...
Re:I love how minimal the whole thing is (Score:2)
Re:I love how minimal the whole thing is (Score:2, Funny)
Re:With AJAX, you know you've got (Score:2)
Clean?? There are greasy fingerprints all over!
Re:With AJAX, you know you've got (Score:2)
Re:With AJAX, you know you've got (Score:2)
Just make sure you TIDY it, or it won't work
Two camps (Score:4, Insightful)
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.
Re:Two camps (Score:5, Informative)
The Three Conditions of AJAX (Score:5, Informative)
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.
Re:The Three Conditions of AJAX (Score:2)
Along those lines... (Score:2)
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".
Re:Two camps (Score:3, Informative)
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:Two camps (Score:2)
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.
Third camp sees this? (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
Re:Third camp sees this? (Score:3, Interesting)
Re:Third camp sees this? (Score:2)
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 [elinks.or.cz], 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, y
Re:Third camp sees this? (Score:2)
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
Re:Two camps (Score:2)
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 th
Re:Two camps (Score:2)
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
Re:Two camps (Score:2)
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
Re:Two camps (Score:2)
Re:Two camps (Score:2)
Re:Two camps (Score:2)
Atlas (Score:5, Informative)
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 [msdn.com] about what Microsoft is doing on the AJAX front elsewhere.
Re:Atlas (Score:3, Informative)
Re:Atlas (Score:2)
Re:Atlas (Score:2)
Re:Atlas (Score:2, Interesting)
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 an
Re:Atlas (Score:2)
Re:Atlas (Score:3, Interesting)
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
Re:Atlas (Score:2)
Re:Atlas (Score:2)
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 co
Re:Atlas (Score:2)
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).
Re:Atlas (Score:2)
Re:Atlas (Score:2)
Re:Atlas (Score:2)
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
My group does
Re:Atlas (Score:2)
Re:Atlas (Score:2)
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.
Re:Atlas (Score:2)
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.
Pssha (Score:2, Funny)
Re:Pssha (Score:2)
ajax agile [google.com]
When you're using java, you can... (Score:4, Informative)
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. [metaparadigm.com]
Personally, I'm a perl monger, so I use this lib [cpan.org], 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.
Re:When you're using java, you can... (Score:3, Insightful)
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 woul
Re:When you're using java, you can... (Score:2)
Re:When you're using java, you can... (Score:2)
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
Re:When you're using java, you can... (Score:2)
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.
Re:When you're using java, you can... (Score:2)
Re:When you're using java, you can... (Score:2)
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.
Re:When you're using java, you can... (Score:2)
Re:When you're using java, you can... (Score:2)
I'm not planning on creating something complex that needs to understand the data pushed to it. I'm trying to avoid
Re:When you're using java, you can... (Score:2)
Here's what happens:
(JS) Rewrite.load(url[, postdata[, callbackfn]]);
(PHP) Create XML document:
Re:When you're using java, you can... (Score:2)
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();">
(js)
function changeit()
{
}
function receive_data(data_from_server)
{
Re:When you're using java, you can... (Score:2)
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
Re:When you're using java, you can... (Score:2, Insightful)
Re:When you're using java, you can... (Score:2)
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
Re:When you're using java, you can... (Score:2)
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<
Re:When you're using java, you can... (Score:2)
I'm not doing a network monitoring tool, I'm not doing a dynamic
Re:When you're using java, you can... (Score:2, Informative)
Still - got a versio
Re:When you're using java, you can... (Score:2)
The real issue is why you'd use one over the other as a wire protocol.
Re:When you're using java, you can... (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
Re:When you're using java, you can... (Score:2)
Re:When you're using java, you can... (Score:3, Interesting)
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.
An "arrr" solution. (Score:2, Interesting)
--
The "are you a script" word for today is platform.
The problem with AJAX is the X (Score:5, Interesting)
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.
Interesting... (Score:2)
My-var1: Something
My-var2: (Something_base64_encoded)
Has been pretty useful for me.
Re:The problem with AJAX is the X (Score:3, Insightful)
Re:The problem with AJAX is the X (Score:2)
Anm
Re:The problem with AJAX is the X (Score:2, Interesting)
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
Re:The problem with AJAX is the X (Score:2)
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 i
Ajax with lots of languages (Score:2, Informative)
IBM comparison (Score:3, Informative)
Better Java Apps with AJAX? (Score:2, Interesting)
Re:Better Java Apps with AJAX? (Score:2)
here [ensode.net] and here [ensode.net].
Ajax, Java, Echo2 (Score:2, Interesting)
Re:Ajax, Java, Echo2 (Score:2)
I wrote a brief intro/howto article about Trackit that can be seen here [ensode.net].
Ajax library for Java (Score:3, Interesting)
If you're looking for a Java library to do some of the heavy lifting, check it out.
For examples... (Score:4, Informative)
And the front end to the webmail for Zimbra http://www.zimbra.com/ [zimbra.com]
Really, really nice stuff.
AJAX can be fun! (Score:4, Interesting)
http://dugnet.com/klown/ajwm/ [dugnet.com], all that's needed are some AJAX functions to swap out the contents of each window, instant freakish web-app thing..
Can't Colgate sue "someone" for using the AJAX (Score:2, Informative)
Re:Can't Colgate sue "someone" for using the AJAX (Score:2)
Re:Can't Colgate sue "someone" for using the AJAX (Score:3, Insightful)
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!
Remarkable omission (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 b
Re:Remarkable omission (Score:3, Interesting)
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.
JWP has a great AjaxTags component (Score:4, Interesting)
http://javawebparts.sourceforge.net/javadocs/inde
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/ [sourceforge.net]
DragNdrop between web pages (Score:2)
AJAX for PHP Developers (Score:2)
Re:AJAX for PHP Developers (Score:4, Informative)
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.
Japano AJAX Integration (Score:3, Insightful)
For me (I am the author of japano [sourceforge.net], an MVC/JSP engine also containing dynamic javascript integration features), the following additional principles are were important:
Hermetic Sandbox (Score:2)
Re:Hermetic Sandbox (Score:2)
Accessibility issues with AJAX (Score:2, Informative)
More on AJAX and accessibility can be found here: AJAX and Accessibility [standards-...ndards.com].
Re:XML is bloated (Score:2)
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 th
Re:XML is bloated (Score:2)
Re:XML is bloated (Score:5, Informative)
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.
GZIP + JSON (Score:2)
Re:Not reading IBM articles (Score:2)