AJAX - PowerPoint PPT Presentation

About This Presentation
Title:

AJAX

Description:

AJAX Daniel Daugherty Daniel_cfug_at_danield.us What is AJAX Asynchronous JavaScript and XML Other terms to know XMLHttpRequest JSON What is AJAX used for Data retrivial ... – PowerPoint PPT presentation

Number of Views:108
Avg rating:3.0/5.0
Slides: 13
Provided by: Daughe2
Category:
Tags: ajax | ajax

less

Transcript and Presenter's Notes

Title: AJAX


1
AJAX
  • Daniel Daugherty
  • Daniel_cfug_at_danield.us

2
What is AJAX
  • Asynchronous JavaScript and XML
  • Other terms to know
  • XMLHttpRequest
  • JSON

3
What is AJAX used for
  • Data retrivial
  • Send data to the server for processing.
  • Form Validation
  • Anything you might load a new page for.
  • It is possible to build One Page Ajax
    Applications.

4
What is AJAX NOT
  • AJAX is NOT DHTML
  • AJAX is commonly used allong with DHTML to
    provide enhanced user interface. But they are 2
    separate things.

5
How to implement AJAX
  • Write XMLHttpRequest your self.
  • Use a AJAX Framework.
  • Many many many many frameworks out there.
  • DWR for JAVA
  • AJAX.CFC DWR.CFC for Coldfusion.

6
DWR Setup
  • Download DWR http//getahead.ltd.uk/dwr/
  • Install DWR.jar in your J2EE server classpath.
  • Edit web.xml to add the DWR as a servlet.
  • Edit DWR.XML to list objects to be made available
    via AJAX.

7
AJAX.CFC /DWR.CFC
  • Unzip AJAX.zip into a folder in your web root.
  • Edit DWR.XML to list objects to be made available
    via AJAX

8
How do I call DWR/AJAX.CFC
  • JS templates are needed
  • engine.js
  • util.js optional but recomeneded.
  • JAVA
  • dwr/interface/JavascriptName.js
  • ColdFusion
  • ajax_js_stub.cfm?componentJavascriptName
  • wddx.js

9
Demo

10
Security
  • Limit the type of things available via AJAX.
  • Java
  • Supports restriction with J2EE roles
  • Security Filter.
  • ColdFusion
  • Application.cfm or Application.CFC
  • cflogin roles

11
Error Handling
  • Client Side
  • DWREngine.setWarningHandler()
  • DWREngine.setErrorHandler()
  • Server Side
  • May need to adjust server side error trapping to
    be AJAX aware.

12
Debugging
  • Server side
  • LOG files are your friend.
  • Client Side
  • Firefox Javascript Debugger
  • Firebugs
  • HTTP Trace utility
  • Javascript alert()
  • DDumper.js - Comes with AJAX.CFC
Write a Comment
User Comments (0)
About PowerShow.com