How to use
What you need on your site
- include dynajax.js
- An HTML interface element (ie a button) you can use to trigger (on click, on mouseover, etc..) the desired action
- A responsefile that processes posted data and displays the result. It can be any serverside application (php, jsp, etc..)
- An HTML element (ie a div) where the results will be put
- An HTML element that contains form input elements to be sent to the responsefile (optional)
How you can send a request
Use the Javascript function dynajax.request('respfile: x; resultloc: y; paramloc: z;')
The attributes:
- In responsefile, specify the name of the responsefile
- In resultloc specify the id of the HTML element the result goes to. Alternatively it can be a Javascript function that handles the result.
- In paramloc(optional) specify the HTML element containing the form elements needed to be sent to the response file
- Note: DynAjax has many additional attributes/features. Check reference to see all possible attributes
A possible use schema
<div id="params">
<input type="text" name="mydata" />
<input type="button" value="Submit"
onclick="dynajax.request('respfile: myresp.php; resultloc: result;
paramloc: params;')" />
</div>
<div id="result">
</div>
Click here to see how to put in practice.