當前位置: 首頁>>代碼示例>>PHP>>正文


PHP xajax::autoCompressJavaScript方法代碼示例

本文整理匯總了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', '');
開發者ID:xajax,項目名稱:xajax,代碼行數:31,代碼來源:swfupload.php

示例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>
開發者ID:xajax,項目名稱:xajax,代碼行數:29,代碼來源:formSubmissionTest.php


注:本文中的xajax::autoCompressJavaScript方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。