Ultra simple Prototype.js AJAX example
1 <h2>ajax replacing link</h2> 2 <a href="backend.php?return=time" 3 onclick="new Ajax.Updater('testdiv', 'backend.php?return=time', 4 {asynchronous:true, evalScripts:true }); return false;"> 5 This link updates a line</a> 6 <div id="testdiv"></div>
With no JavaScript turned on, it'll go to the normal URL. Without, it'll do an XMLHTTPRequest and put the result in #testdiv.