PHP Classes

File: tests/inline_call.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in Bookmark in
  Classes of Guilherme Blanco  >  pAjax  >  tests/inline_call.php  >  Download  
File: tests/inline_call.php
Role: Example script
Content type: text/plain
Description: Inline call first test
Class: pAjax
Do RPC calls from the browser without page reloads
Author: By
Last change: - Updated tests to allow working with disabled domain protection and with
enabled export protection
Date: 9 years ago
Size: 951 bytes


Class file image Download

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

foobar() { return "foo"; }

$AJAX = new pAjax;

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

<html xmlns="" 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!" />