Exemplo n.º 1
0
 private static function Initialize()
 {
     if (!isset(self::$_INSTANCE) && !is_object(self::$_INSTANCE)) {
         $c = __CLASS__;
         self::$_INSTANCE = new $c();
     }
     return self::$_INSTANCE;
 }
<?php

/**
 *
 *
 * @version $Id$
 * @copyright 2007
 */
require_once "Classes\\class.AjaxMethod.php";
AjaxMethod::HandleAjaxRequest();
function _getFullDateTime()
{
    return "<root><date>" . date("D M j G:i:s T Y") . "</date></root>";
}
function _getFullTime()
{
    //throw new Exception("ah ha ha");
    return "<time>" . date("D M j G:i:s T Y") . "</time>";
}
Exemplo n.º 3
0
<input type="button" name="requestTime" value="Get Full Name" onclick="getFullName('20 Nguyen Van Cu', 'Tran', 'Anh', 'Tuan');" />
<br />
<div style="padding: 10px; width: 280px; text-align: right">
Num A:&nbsp;<input type="text" name="numA" id="numA" size="5">&nbsp;&nbsp;&nbsp;&nbsp;
Num B:&nbsp;<input type="text" name="numB" id="numB" size="5"><br />
Result:&nbsp;<input type="text" name="numRes" id="numRes" size="25"><br />
<input type="button" name="optAdd" value="+" onclick="opt('+');" />
<input type="button" name="optSubs" value="-" onclick="opt('-');" />
<input type="button" name="optMulti" value="*" onclick="opt('*');" />
<input type="button" name="optDivi" value="/" onclick="opt('/');" />
<input type="button" name="optDivi1" value="Get Fulle DateTime" onclick="alert(_getFullDateTime());" />
</div>
<div>
    <div style="text-align: right">
        <input type="button" id="btnGetServOject" value="Get Server Veriables" onclick="get_ServerVars()">
        <input type="button" id="btnGetReqVars" value="Get Request Veriables" onclick="get_ReqVars()">
    </div>
    <textarea id="oServArea" style="width: 100%; height: 280px;"></textarea>
    <?php 
AjaxMethod::$OnComplete = "ExtCallComplete";
AjaxMethod::$Debug = TRUE;
AjaxMethod::RegExtAjaxMethods("AjaxMethodHandler.php", array("_getFullDateTime", "_getFullTime"));
?>
</div>
<?php 
AjaxMethod::$OnComplete = "CallComplete";
AjaxMethod::$Debug = TRUE;
AjaxMethod::RegAjaxMethods();
?>
</body>
</html>