panglongphp
(panglongphp)
注册会员

初级会员
UID 65962
精华
0
积分 159
帖子 81
金钱 159 喜悦币
威望 0
人脉 0
阅读权限 20
注册 2005-8-18 来自 1
状态 离线
|
求助:一个XAJAX 的奇怪问题
以下是一个简单例子:
text.php
<?
include_once("../xajax/xajax.inc.php");
$xajax = new xajax();
function resetsell()
{
$objResponse = new xajaxResponse();
$objResponse->addAlert("成功");
return $objResponse->getXML();
}
$xajax->registerFunction("resetsell");
$xajax->processRequests();
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<?php $xajax->printJavascript("../xajax"); ?>
<title>无标题文档</title>
</head>
<body>
<a href="#" onClick="xajax_resetsell()">成功
</a>
</body>
</html>
以上例子运行成功
但我改了一下后 就不行了,改修如下:(config.php 和 text.php 在同一个目录下)
config.php
<?php
include_once("../xajax/xajax.inc.php");
$xajax = new xajax();
?>
text.php
<?
include_once("./config.php");
function resetsell()
{
$objResponse = new xajaxResponse();
$objResponse->addAlert("成功");
return $objResponse->getXML();
}
$xajax->registerFunction("resetsell");
$xajax->processRequests();
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<?php $xajax->printJavascript("../xajax"); ?>
<title>无标题文档</title>
</head>
<body>
<a href="#" onClick="xajax_resetsell()">成功
</a>
</body>
</html>
出现一个警告:
Cannot modify header information -headers already sent by(out put..)...
You have whitespace in your response
这是什么回事了 ,我只是把 代码放在 一个文件 再用 include_once()调用 怎么会出现错误的 。
甚至 text.php 什么也没有修改,就是用一个 include_once("./config.php"); 也会出现这个警告
谢谢指教!!!
[ 本帖最后由 panglongphp 于 2006-8-8 07:03 PM 编辑 ]
|
|