xajax - 调用静态方法时响应错误
使用 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
你的问题充其量是模棱两可的。您返回的错误很容易描述...您当前返回无效的响应(即代码/非格式化的 xml 文档)。
一般来说,我在一个类中设置一个邮件函数,并将该类包含到我的 xajax 响应中,以便我可以在 objectResponse 值之前通过电子邮件给自己发送响应。
$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.
$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.