本文整理匯總了PHP中xajax::autoCompressJavaScript方法的典型用法代碼示例。如果您正苦於以下問題:PHP xajax::autoCompressJavaScript方法的具體用法?PHP xajax::autoCompressJavaScript怎麽用?PHP xajax::autoCompressJavaScript使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類xajax
的用法示例。
在下文中一共展示了xajax::autoCompressJavaScript方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: transfield
$core = '../../xajax_core';
require_once $core . '/xajax.inc.php';
$xajax = new xajax();
require_once '../../xajax_plugins/response/swfupload/swfupload.inc.php';
$xajax->configure("javascript URI", "../../");
$xajax->configure("responseType", "XML");
$xajax->register(XAJAX_FUNCTION, "uploader", array("mode" => "'SWFupload'", "SWFform" => "'upload_form'"));
$xajax->register(XAJAX_FUNCTION, "transform");
$xajax->register(XAJAX_FUNCTION, "transfield");
$xajax->register(XAJAX_FUNCTION, "destroyfield");
$xajax->register(XAJAX_FUNCTION, "sync_test", array('mode' => "'synchronous'"));
$xajax->register(XAJAX_FUNCTION, "destroyform");
$_SESSION['foo']++;
$xajax->processRequest();
// This is dev code, you don't need these lines for using the SWFupload plugin.
$xajax->autoCompressJavaScript(null, true);
$xajax->autoCompressJavaScript('../../xajax_plugins/response/swfupload/swfupload.xajax.js', true);
$xajax->autoCompressJavaScript('../../xajax_plugins/response/swfupload/swfupload.js', true);
function transfield()
{
$objResponse = new xajaxResponse();
$foo = "\n\t\t\t<input type='text' name='testfieldtext' value='foo' /><br />\n\t\t\t<input type='file' name='filetest' id='filetest' />\n\t\t";
$objResponse->assign('fieldtest', 'innerHTML', $foo);
$objResponse->clsSwfUpload->transField('filetest', array("file_types" => "*.jpg;*.gif;*.png;", "file_types_description" => "Image Files or mp3", "file_size_limit" => "5 MB", "upload_complete_handler" => "function () {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}", "post_params" => array("PHPSESSID" => session_id())), true);
return $objResponse;
}
function destroyField()
{
$objResponse = new xajaxResponse();
$objResponse->clsSwfUpload->destroyField('filetest');
$objResponse->assign('fieldtest', 'innerHTML', '');
示例2: testForm
require_once "../xajax_core/xajax.inc.php";
function testForm($formData)
{
$objResponse = new xajaxResponse();
$objResponse->alert("formData: " . print_r($formData, true));
$objResponse->assign("submittedDiv", "innerHTML", nl2br(print_r($formData, true)));
return $objResponse;
}
$xajax = new xajax();
//$xajax->configure("debug", true);
$xajax->register(XAJAX_FUNCTION, "testForm");
$xajax->processRequest();
$xajax->configure('javascript URI', '../');
#$xajax->configure('useUncompressedScripts',true);
$xajax->autoCompressJavaScript(null, true);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/2000/REC-xhtml1-20000126/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Form Submission Test| xajax Tests</title>
<style type="text/css">
fieldset > div {
border : 1px solid gray;
padding : 5px;
background-color : white;
}
</style>