Programming Tutorials Browser Tutorials Articles Struts Tutorials Hibernate Tutorials

  Tutorial: Easy Ajax Programming

Using the new XMLHttpRequest JavaScript object can make your website design take on new and exciting capabilities.

Tutorial Details:

Summary
Use the javascripts on this page and add your own custom functions
Use an XML template to start with, then move to module-based generation if necessary
Make use of XML to pass other values back and forth
The Skinny
Being able to reload parts of a web page is an invaluable addition to the web programmer's toolkit. Adaptive Path1 calls this "Ajax" and promises that websites can be more usable if written with these technologies in mind.
Of course, any technology can also muck things up. I predict that misdirected applications of Ajax will do more to make sites flashy than to make them useful. But, as always, the potential is there to do it well!2
To start with, many sites are using Ajax to provide a search function that shows results inline. However, there are many other ways this can be used.
Usage
Using the javascripts available on this page, do the following:
1.Include ajax.js and another file with your own custom scripts.
2.Include a cgi_url variable in your custom javascript that points to a server script that will generate your XML (using a database or whatever else you want to use).
3.Write custom functions that handle both the sending and receiving of data. (See examples.) Send the name of your callback function as the 'f' parameter (this JavaScript function will be called when your data is received back from the server).
Conclusion
I recommend starting with simple values and branching out into more complex data structures only when necessary. Make the server do much of the work instead of relying on the client. I like to use HTML templates setup on the server, then fill a
on the client with the full results of a query.


 

Read Tutorial at: Click here to view the tutorial

Rate Tutorial:
Easy Ajax Programming

View Tutorial:
Easy Ajax Programming

Related Tutorials:

SQLJ: The 'open sesame' of Java database applications
SQLJ: The 'open sesame' of Java database applications
 
Design networked applications in RMI using the Adapter design pattern
Design networked applications in RMI using the Adapter design pattern
 
RMI over IIOP - JavaWorld December 1999
RMI over IIOP - JavaWorld December 1999
 
C# : A language alternative or just J--? (part1)
C# : A language alternative or just J--? (part1)
 
Build your own languages with JavaCC - JavaWorld December 2000
Build your own languages with JavaCC - JavaWorld December 2000
 
I want my AOP!, Part 3
I want my AOP!, Part 3
 
Object-relation mapping without the container
If you follow the latest developer buzz then you\\\\\'ve likely heard of IOC (Inversion of Control) containers and AOP (aspect-oriented programming).
 
Ganymede
A log4j plugin to Eclipse that works similar to chainsaw (SocketServer). Includes color, filtering, detailed information, and saves settings.
 
Good article on how to adopt XP
Good article on how to adopt XP xtreme programming (XP) is a software development methodology that makes coding the primary activity. By promoting values such as simplicity and feedback, XP allows Java programmers to incrementally develop and test applic
 
JAligner
JAligner JAligner is an open source Java implementation of the Smith-Waterman algorithm with Gotoh's improvement for biological local pairwise sequence alignment using the affine gap penalty model.
 
Performance Analysis of J2EE Applications Using AOP Techniques
Performance Analysis of J2EE Applications Using AOP Techniques In this article we demonstrate the use of AOP techniques through which J2EE applications can be easily instrumented without any modifications to application code. We have developed a very sim
 
JDBC scripting, Part 2
JDBC scripting, Part 2 Programming and Java scripting in JudoScript Summary JudoScript is a rich functional scripting language, and an easy and powerful general programming and Java scripting language. JudoScript's power comes from its synergy of
 
Getting Groovy with XML
XML sucks. Oh, wait, XML rocks. Well, it actually does a lot of both. It rocks because of all of the editors, validators, and tools written for it. XML has all but replaced any notion of a new custom text-based data language. But it also sucks because it\
 
Annotations in Tiger, Part 1: Add metadata to Java code
Annotations, a new feature in J2SE 5.0 (Tiger), brings a much-needed metadata facility to the core Java language. In this first of a two-part series, author Brett McLaughlin explains why metadata is so useful, introduces you to annotations in the Java lan
 
alt.lang.jre: Take a shine to JRuby
JRuby combines the object-oriented strength of Smalltalk, the expressiveness of Perl, and the flexibility of the Java class libraries into a single, efficient rapid development framework for the Java platform. In this third installment in the alt.lang.jre
 
Prova
Prova: A Language for Rule Based Java Scripting, Information Integration, and Agent Programming
 
SeSAm - Shell for Simulated Agent Systems
Multi-Agent Simulation Environment SeSAm (Shell for Simulated Agent Systems) provides a generic environment for modelling and experimenting with agent-based simulation. We specially focused on providing a tool for the easy construction of complex models,
 
FreeMarker FreeMarker 2.3.1 an open-source HTML template engine.
FreeMarker provides an easy way to get data from Java servlets into Web pages, and helps you keep graphic design separate from application logic. To use it, you encapsulate HTML in templates.
 
Hibernate simplifies inheritance mapping.
Learn three easy-to-implement strategies to map class hierarchies. Hibernate is an object-relational mapping and persistence framework that provides a lot of advanced features, ranging from introspection to polymorphism and inheritance mapping.
 
Techniques used for Generating Dynamic Content Using Java Servlets.
Techniques used for Generating Dynamic Content Using Java Servlets. Techniques used for Generating Dynamic Content Common Gateway Interface (CGI) For any web application high performance and timely delivery are key ingredients to competitive
 
Site navigation
 

 

Send your comments, Suggestions or Queries regarding this site at roseindia_net@yahoo.com.

Copyright © 2006. All rights reserved.