⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 example9_10.php

📁 PHP+Ajax网站开发典型实例
💻 PHP
字号:
<?php
require ('../xajax.inc.php');
function helloWorld($isCaps)
{
	if ($isCaps)
		$text = "CLICK ME!";
	else
		$text = "click me!";
		
	$objResponse = new xajaxResponse();
	$objResponse->addAssign("div1","innerHTML",$text);
	
	return $objResponse;
}
function setColor($sColor)
{
	$objResponse = new xajaxResponse();
	$objResponse->addAssign("div1","style.color", $sColor);
	
	return $objResponse;
}
$xajax = new xajax(); 
//$xajax->debugOn(); // Uncomment this line to turn debugging on
$xajax->registerFunction("helloWorld");
$xajax->registerFunction("setColor");
$xajax->processRequests();
?>
<html>
<head>
	<title>xajax example</title>
	<?php $xajax->printJavascript('../'); ?>
</head>
<body style="text-align:center;">
<img src=top.gif width="100%">
	<div id="div1" name="div1">&#160;</div>
	<br/>
	
	<button onclick="xajax_helloWorld(0)" >Click Me</button>
	<button onclick="xajax_helloWorld(1)" >CLICK ME</button>
	<script type="text/javascript">
	xajax_helloWorld(0);
	xajax_setColor(document.getElementById('colorselect').value);
	</script>
<table width="100%" style="font-size:12px;border-top-style:solid;border-bottom-style:none;border-right-style:none;border-left-style:none;" cellspacing="0" cellpadding="4" align="center">
              <tr> 
                  <td> <div align="center"> 
                    IT在中国电脑学习网!@2007</br>
                    公司地址:郑州市二七路200号金博大D座2708室</br>
                    电话:66202195
                    电子邮件:<A HREF='mailto:liuhaisong9462@sohu.com'></A> itzcn@126.com
                    </div></td>
              </tr>
</table>
</body>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -