Cool Penguin

PlainAjax - keeping Ajax simple

Tutorial

Send Ajax request to the server

Task description

Displaying the server's time or user's IP in a HTML element by clicking on links.

Working example

Clickable links
Display server time
Display user's IP

Server response

The server's response will appear here

Implementation steps


The HTML Code

<a onclick="plainajax.request('respurl: servertime.php; resultloc: myresult;')">Display server time</a>
<a onclick="plainajax.request('respurl: userip.php; resultloc: myresult;')">Display user's IP</a>
<div id="myresult"></div>

Note: the server-side scripts (defined in respurl attribute) can be implemented in any language, java, ruby, php, etc..

Check another example on how to