xajax 例题出错.the xml response...... the XMLresponse that was returned from the server is invalid. ..... undefined variable: sResponse......找了很多例子程序,都出现这个. 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 <?phprequire_once("/xajax.inc.php");$xajax = new xajax();$xajax->registerFunction("showOutput");function showOutput(){ $testResponse = new xajaxResponse(); $testResponse->addAlert("Hello"); $testResponse2 = new xajaxResponse(); $testResponse2->loadXML($testResponse->getXML()); $testResponse2->addReplace("this", "is", "a", "replacement"); $testResponseOutput = htmlspecialchars($testResponse2->getXML()); $objResponse = new xajaxResponse(); // 在响应实例中添加一个命令,用来将id为submittedDiv的innerhtml元素属性变为新的内容$testResponseOutput. $objResponse->addAssign("submittedDiv", "innerHTML", $testResponseOutput); return $objResponse;}$xajax->processRequests();?><!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><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>xajaxResponse Test</title><?php /* 第六步:在该页的<head>和</head>标签之间插入下列代码,使xajax实例可以自己生成所必需的js */$xajax->printJavascript("./")?></head><body><!--第七步:在这里调用 --><p><div onclick="xajax_showOutput();"> 点击这里显示响应XML </div></p><div id="submittedDiv">这里将被响应的xml替换</div></body></html> /xajax.inc.php又是从哪现成拷的! PHP100下载的.你有新的吗.给我个好吗. 新工具来了,呵呵 请教个时间戳字段查询的问题 我用mbstring扩展时的问题~~~怎么办?? 点击打印按钮 这个哈希值怎么取不到呢 二级分类添加文章 插入了记录,但是记录的字段都没有进去是怎么回事情? 关于php对gif动画的支持问题 用PHP如何接收前面网页传递的变量 jquery批量上传是Post提交导致整个表单没法提交至后台? ICONV函数的应用 PHP使用CURL上传文件
require_once("/xajax.inc.php");
$xajax = new xajax();
$xajax->registerFunction("showOutput");
function showOutput(){
$testResponse = new xajaxResponse();
$testResponse->addAlert("Hello");
$testResponse2 = new xajaxResponse();
$testResponse2->loadXML($testResponse->getXML());
$testResponse2->addReplace("this", "is", "a", "replacement");
$testResponseOutput = htmlspecialchars($testResponse2->getXML());
$objResponse = new xajaxResponse();
// 在响应实例中添加一个命令,用来将id为submittedDiv的innerhtml元素属性变为新的内容$testResponseOutput. $objResponse->addAssign("submittedDiv", "innerHTML", $testResponseOutput);
return $objResponse;
}
$xajax->processRequests();
?>
<!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>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>xajaxResponse Test</title>
<?php
/* 第六步:在该页的<head>和</head>标签之间插入下列代码,使xajax实例可以自己生成所必需的js */
$xajax->printJavascript("./")
?>
</head>
<body>
<!--第七步:在这里调用 -->
<p><div onclick="xajax_showOutput();"> 点击这里显示响应XML </div></p><div id="submittedDiv">这里将被响应的xml替换</div></body>
</html>