$cb = new Ajax("cb"); $cb->OnRequest = "onCallback"; $cb->OnComplete = "onCallbackComplete"; $cb->OnError = "onCallbackError"; $cb->OnAbort = "onAbort"; $cb->Debug = true; //$cb->RefreshInterval = 5000; $cb->LoadingPanelTemplate = parseInclude("waiting.html"); $cb->LoadingPanelFadeDuration = 2; $cb->RequestPrefix = "/pajax/AjaxHandler.php"; $cbA = new Ajax("cbA"); $cbA->OnRequest = "onCallback"; $cbA->OnComplete = "onCallbackComplete"; $cbA->OnError = "onCallbackError"; $cbA->Debug = true; $cbA->LoadingPanelTemplate = parseInclude("waiting.html"); $cbA->LoadingPanelFadeDuration = 2; $cbA->RequestPrefix = "/pajax/AjaxHandler.php"; ?> <html> <head> <title>CallbackHandler Demo</title> <script language="javascript"> function doCallback() { cb.addParameter("Name", "Pham Van Dung"); cb.addParameter("Email", "*****@*****.**"); cb.addParameter("Phone", ["2543243", "2554545", "35435435"]); cb.request("hi hi", "khi khi"); } function doCallbackA() { cbA.addParameter("Name", "Pham Van Dung");
/** */ function knitFiles($files, $base = '') { $content = ''; foreach ($files as $file) { $path = $base . $file; if (!file_exists($path) || !is_readable($path)) { throw new Exception("Cannot read any file at '{$path}'."); } $content .= file_get_contents($base . $file) . "\n"; } $content = parseInclude($content, $base); return $content; }