PostNuke: A Flexible Open Source Content Management System
home | forum | international support | contact us

Documentation Wiki

How and where to use Ajax


and where we should not use it.

Basically Ajax can be used where you would like an interaction between your module and the server without reloading the page, for example for an input validation of a form.

Overview
It consists of three processes:
1. An event such as a pressed button calls a javascript program. The javascript itself is in the pnjavascript directory. That javascript program sends a request to the server by (invisibly) calling a web page. That web page is in your module directory and should be called pnajax.php.
2. The pnajax.php code elaborates the request and prepares the return data.
3. Another javascript program - still in the pnjavascript directory, probably in the same file - elaborates the data it receives to display them.

In the example of validating a form, these three steps look as follows:
1. When pressing the send button, the javascript program collects the inputs, prepares a http request and sends it to pnajax.php.
2. The pnajax.php validates the inputs, eventually using the data base, and decides whether the inputs are acceptable or not.
3. Another javascript program receives the verdict of pnajax.php and displays an eventual error or sends the data definitively to the host.


CategoryKnowledgeBase
XML Revisions of $tag
Page history :: Last Editor [ Rundum ] :: Owner [ markwest ] ::
Valid XHTML :: Valid CSS :: Powered by pnWikka 1.0 (A wiki fork from WikkaWiki)
 

1 Comments so far

(Latest comments )

TheAdmiral's Avatar

1. TheAdmiral wrote on Feb 26, 2008 at 04:52 AM

Like reading Klingon.

Main Menu

Extensions Database

Documentation

Development

Login





 


 Log in Problems?
 New User? Sign Up!

Donate to PostNuke