• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

AJAX

 
Ranch Hand
Posts: 3852
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Does any one have implemented AJAX (Asynchronous Javascript And XML)???

Can any one tell the basic logic behind it???

Thanks.
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
There is plenty of information out there. Do a serch on Google for what you are looking for. AKA. Ajax Servlets / Ajax JSP / AJAX Double Combo / Etc.

Eric
 
Sheriff
Posts: 14691
16
Eclipse IDE VI Editor Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ajax Servlets / Ajax JSP / AJAX Double Combo / Ajax In Action
 
ankur rathi
Ranch Hand
Posts: 3852
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks.

I know, I can get detailed material on net but I am looking for a basic idea in user friendly, simple language.

 
Ranch Hand
Posts: 245
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi

Check out this Ajax Wiki
 
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have an extremely simple demo which I can post, but unfortunately i do not have access to it at the moment. I'll try to post it in the next day or two.
 
Ranch Hand
Posts: 1026
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


I'll try to post it in the next day or two.



That's so nice of you bartender.
 
ankur rathi
Ranch Hand
Posts: 3852
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by David O'Meara:
I have an extremely simple demo which I can post, but unfortunately i do not have access to it at the moment. I'll try to post it in the next day or two.



Thank you so much David.
 
Ranch Hand
Posts: 8945
Firefox Browser Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
http://demo.script.aculo.us/shop
 
author
Posts: 30
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
OK, I can't resist... if you really are coming to Ajax completely new, then Head Rush Ajax is an ideal book. It takes you from ground zero to a well-rounded Ajax developer, and you'll get a really strong grounding in asynchrony, the role of the browser, data formats, etc. Check it out...

Sorry, self-promotion. But that was too much of a softball to resist :-)

Thanks
Brett
 
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I have recently implemented Ajax in my project. Really impressive.

In our portal server application, firing a "dynamic data request" from a portlet was refreshing the whole page & reloaded all the porlets in the portal server page.

By using Ajax, we simply retrieved the data without refreshing the whole page & that improved the system performance.

Regards.
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE VI Editor Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Sorry, self-promotion


That is what the book promotion is for
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I emailed the demo to Rathi, but here is an extremely simple demo...

Servlet:
(Takes a request with a number, returns the number and a random number as xml)


Web page:
(clicking the link sends an asnch request, receives and decodes the response then pops the data in an alert box)


The 'net.js' is a modified version taken from Eric's book
Note you need to swap on_error and on_load and remove the underscore before it will work.


Hopefully you know how to join the three together

Enjoy,
Dave.
[ April 29, 2006: Message edited by: David O'Meara ]
 
Ranch Hand
Posts: 156
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hey this is really good, pretty usefull, I think I'll try it out...
 
Eric Pascarello
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Dave,

Can I ask why in the world are you checking
if (http_request.readyState == 4){(http_request.status == 200)

inside the function when the content loader does that before it calls the next step.

Eric
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hey it was there when I copied it!
Do you have a recommendation of how it should be?

(Sorry, I copied the ContentLoader part from one of your examples. If you have a problem feel free to remove it)
 
Eric Pascarello
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The content loader does th check already for the 4 and 200. Look at contentLoader and you will see that. It does the check with the costant holding 4 and then looks for 300. If it is a match it calls your function that handles the request.

So you basically just need to remove the if statements in your code that are performing the same check. Only way that code will be called is it it is complete.

Eric
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ah I see what you mean, it was being done in the ContentLoader and the callback method. I had missed that. Thanks
 
Ranch Hand
Posts: 100
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have implemented an Ajax application to provide "lazy loading" of a tree-like structure that is part of the enterprise IT Service Management (ITSM) product on which I work. The actual JavaScript code is pretty simple because the XML that I get back from the backend server throught the web servlet is rather straight-forward and the DOM parsing features of JavaScript make short work of it. The web servlet side of things was pretty much just a pass through of the request from the browser to the backend server and then passing back the XML from the backend down to the browser.

Even when all laid out nice and pretty, with white space, well placed braces, one statement to a line, comments, etc. the JavaScript code is only about 750 lines.

It was much easier than I had expected.
 
reply
    Bookmark Topic Watch Topic
  • New Topic