dongping8572 2009-11-24 18:24
浏览 26

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

  • 写回答

1条回答 默认 最新

  • dongyun6229 2011-03-18 17:00
    关注

    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.

    评论

报告相同问题?

悬赏问题

  • ¥15 微信公众号自制会员卡没有收款渠道啊
  • ¥15 stable diffusion
  • ¥100 Jenkins自动化部署—悬赏100元
  • ¥15 关于#python#的问题:求帮写python代码
  • ¥20 MATLAB画图图形出现上下震荡的线条
  • ¥15 关于#windows#的问题:怎么用WIN 11系统的电脑 克隆WIN NT3.51-4.0系统的硬盘
  • ¥15 perl MISA分析p3_in脚本出错
  • ¥15 k8s部署jupyterlab,jupyterlab保存不了文件
  • ¥15 ubuntu虚拟机打包apk错误
  • ¥199 rust编程架构设计的方案 有偿