Помогите с req.responseText

Тема в разделе "JavaScript и AJAX", создана пользователем Tamerlan, 31 май 2007.

  1. Tamerlan

    Tamerlan Активный пользователь

    С нами с:
    27 апр 2007
    Сообщения:
    16
    Симпатии:
    0
    В Backende:

    PHP:
    <?

    require_once 
    "lib/JsHttpRequest/JsHttpRequest.php";
    $JsHttpRequest =& new JsHttpRequest("windows-1251");

    ?>

    <table width="100%" height="100%" cellpadding="0" cellspacing="0" border="0">
                               <tr height="1">
                                    <td width="1"></td>
                                    <td colspan="2"><img src="_img/pic7.gif" width="100%" height="1" alt="" border="0"></td>
                                    <td width="1"></td>
                                </tr>
                                <tr>
                                    <td><img src="_img/pic7.gif" width="1" height="100%" alt="" border="0"></td>
                                    <td><img src="_img/pic6.gif" width="16" height="32" alt="" border="0"></td>
                                    <td width="100%" height="32" style="background-image: url('_img/pic11.gif');" ><font style="font-family: Tahoma; font-size: 10pt; font-weight: bold; color: FFFFFF;" >PRODUCTIE</font></td>
                                    <td><img src="_img/pic7.gif" width="1" height="100%" alt="" border="0"></td>
                                </tr>
                                <tr>
                                    <td><img src="_img/pic7.gif" width="1" height="100%" alt="" border="0"></td>
                                    <td colspan="2" height="1"><img src="_img/pic7.gif" width="100%" height="1" alt="" border="0"></td>
                                    <td><img src="_img/pic7.gif" width="1" height="100%" alt="" border="0"></td>
                                </tr>
    </table>
                        
    А в Frontende:

    [js]

    function LoadContent(menu,action) {

    // Create new JsHttpRequest object.
    var req = new JsHttpRequest();
    // Code automatically called on load finishing.
    req.onreadystatechange = function() {
    if (req.readyState == 4) {
    // Write result to page element (_RESULT becomes responseJS).
    // document.getElementById('content').innerHTML = req.responseJS.mainContent;
    // Write debug information too (output becomes responseText).
    document.getElementById('content').innerHTML = req.responseText;
    }
    }
    // Prepare request object (automatically choose GET or POST).
    if (menu == "1") { req.open(null, 'acasa.php', true); }
    // Send data to backend.
    req.send();

    }

    [/js]

    document.getElementById('content').innerHTML = req.responseText; вот тут он ругается.

    Почему?
     
  2. armadillo

    armadillo Активный пользователь

    С нами с:
    6 апр 2007
    Сообщения:
    2.370
    Симпатии:
    0
    Адрес:
    Russia, Moscow
    Как?
    где элемент content?
    Сам как считаешь, что-то читабельно?