xajax - 调用静态方法时响应错误

发布于 2024-08-12 04:00:56 字数 435 浏览 9 评论 0原文

使用 XAJAX 时,我调用了一个修剪字符串的函数。这是一个简单的函数,并且按预期工作。

现在我想让这个函数可供整个系统使用,所以我将它作为静态方法添加到辅助类中。自从我将此函数移至此类后,我得到了一个不好的响应,类似这样。


Error: the XML response that was returned from the server is invalid.
Received:



some code here...



You have whitespace in your response.

大多数情况下,当出现致命错误时,会出现此消息,但错误日志中没有显示任何内容... 真的不知道从这里做什么,有什么建议吗?

我已经包含了该文件,所以我知道这不是包含问题,静态方法被调用,但从 XAJAX 返回的响应很糟糕。

谢谢

When using XAJAX I have a call to a function that trims a string. this is a simple function and works just as expected.

Now I want to make this function available to the whole system so I have added it to a helper class as a static method. ever since I moved this function to this class I get a bad response, something like this.


Error: the XML response that was returned from the server is invalid.
Received:



some code here...



You have whitespace in your response.

This message most of the times comes up when there is a fatal error, but nothing shows up in the error log...
don't really know what to do from here, any suggestions?

I have included the file, so I know is not an include problem, the static method gets called, but the response that comes back from XAJAX is bad.

Thank you

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

作死小能手 2024-08-19 04:00:56

你的问题充其量是模棱两可的。您返回的错误很容易描述...您当前返回无效的响应(即代码/非格式化的 xml 文档)。

一般来说,我在一个类中设置一个邮件函数,并将该类包含到我的 xajax 响应中,以便我可以在 objectResponse 值之前通过电子邮件给自己发送响应。

function xajax_loader($formdata){
global $cms,$debug;
$objResponse = new xajaxResponse();
$dataset = $cms->get_data($cms->_getpage);
$columns = $cms->get_columns($cms->_getpage);
$objResponse->loadXml(search($dataset, $formdata, $columns));
//$debug->phpmailer($dataset,$cms->_getcurrentuser());
return $objResponse;
}

$frw->xajax->registerFunction('xajax_loader');

另请注意:如果您使用 Mozilla,请查看您的错误控制台,它会告诉您哪一行出现故障。 IE8/9 F12 和类似的结果将在脚本调试器中提供。

Your question is ambigious at best. It's pretty easily described by the error your returning ... your currently return an invalid response (i.e. code/non-formatted xml documentation).

Generally, I setup a mail function in a class and include that class into my xajax responses so that I can email myself the response before objectResponse the value.

function xajax_loader($formdata){
global $cms,$debug;
$objResponse = new xajaxResponse();
$dataset = $cms->get_data($cms->_getpage);
$columns = $cms->get_columns($cms->_getpage);
$objResponse->loadXml(search($dataset, $formdata, $columns));
//$debug->phpmailer($dataset,$cms->_getcurrentuser());
return $objResponse;
}

$frw->xajax->registerFunction('xajax_loader');

Also of note: if you are using Mozilla View your Error Console and it will tell you which line you have a failure on. IE8/9 F12 and similar results will be provided in the script debugger.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文