Login   Register  
PHP Classes
elePHPant
Icontem

File: tests/client.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Guilherme Blanco  >  pAjax  >  tests/client.php  >  Download  
File: tests/client.php
Role: Example script
Content type: text/plain
Description: Client Script for URI test
Class: pAjax
Do RPC calls from the browser without page reloads
Author: By
Last change: Updated content
Date: 9 years ago
Size: 1,091 bytes
 

Contents

Class file image Download
<?php

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

?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
    <head>
        <title>Server Info retriever</title>
        <?php pAjax::showJavaScript(".."); ?>
        <script type="text/javascript">
              function Server() {
                  pAjax.call(this);
                  pAjax.setDebugMode(true);
              }


              var _p = Server.prototype = new pAjax;


              _p.getInfo = function () {
                  var oRequest = this.prepare("test", pAjaxRequest.POST);
                oRequest.setURI("server.php");
                oRequest.execute(pAjaxRequest.ASYNC);
              }


              _p.onLoad = function () {
                var data = this.getResponse();

                for (var item in data)
                    alert(item + " = " + data[item]);
              }
        </script>
    </head>

    <body>
        <input type="button" name="check" value="Get Server Info"
            onclick="(new Server()).getInfo(); return false;">
    </body>
</html>