本文整理汇总了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>