Location: PHPKode > scripts > pAjax > pajax/tests/inline_call.php

require_once "../class.pAjax.php";

function foobar() { return "foo"; }

$AJAX = new pAjax;

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"

<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
    <title>Inline Ajax Call Example</title>
    <?php $AJAX->showJavaScript(".."); ?>

    <h1>Inline call test with no arguments</h1>
    <p>Call the function 'foobar' on server and get its response</p>
    <script type="text/javascript">
        var func = function (e) {
            // "e" is the content of pAjax.getResponse()
    <input type="button" onclick="pAjaxCall(null, 'foobar', func)" value="Click me!" />
Return current item: pAjax