1 / 12

AJAX

AJAX. Daniel Daugherty Daniel_cfug@danield.us. What is AJAX. Asynchronous JavaScript and XML Other terms to know XMLHttpRequest JSON. What is AJAX used for. Data retrivial Send data to the server for processing. Form Validation Anything you might load a new page for.

bonifacy
Télécharger la présentation

AJAX

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. AJAX Daniel Daugherty Daniel_cfug@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?component=[JavascriptName] • 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

More Related