the XMLresponse that was returned from the server is invalid.  .....  undefined variable: sResponse......
找了很多例子程序,都出现这个.

解决方案 »

  1.   

    <?php
    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>
      

  2.   

    /xajax.inc.php又是从哪现成拷的!
      

  3.   

    PHP100下载的.你有新的吗.给我个好吗.