"Line 15 object required" when using ajaxlib.js

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • kujtim
    New Member
    • Sep 2007
    • 11

    "Line 15 object required" when using ajaxlib.js

    i have problem using ajaxlib.js i have includet as it should in the same directoryy the ajaxlib.js with my codee but i am reciving error "line 15 object required " .

    here is my codeee ......
    testest.html :
    /////////////////////////////////////////////////[code=html]
    <html>
    <head>
    <title>Testin g AJAXLib</title>

    <script type = "text/javascript" src = "D:\AJAX\LIBRA\ complete\step8\ ajaxlib.js"></script>
    <script language = "javascript ">
    [/code][code=javascript]
    function decodeXml()
    {
    var options = resultXML.getEl ementsByTagName ("options");

    var loopIndex;
    var div = document.getEle mentById('targe tDiv');
    div.innerHTML = "The first color is " +
    options[0].firstChild.dat a;

    }[/code][code=html]
    </script>
    </head>

    <body>

    <H1>Testing AJAXLib</H1>

    <form>
    <input type = "button" value = "Display Message"
    onclick = "loadXMLDoc('op tions1.php', decodeXml, false)">
    </form>

    <div id="targetDiv" >
    <p>The fetched data will go here.</p>
    </div>

    </body>
    </html>
    [/code]
    //////////////////////////////////////////

    and options1.php code is here

    //////////////////////////////////////////////////
    [code=html]
    <html>

    <head>
    <title></title>
    </head>

    <body>
    [/code][code=php]
    <?php
    header("content-type:text/xml");
    $options = array ('red','green', 'blue');
    echo '<?xml version = "1.0"?>';
    echo '<options>';
    foreach ($options as $value)
    {
    echo '<options>';
    echo $value;
    echo '<options>';
    }
    echo '<options>';
    [/code][code=html]
    ?>

    </body>

    </html>[/code]


    i also have problem using otherr ajax framework's pleasee help
    Last edited by pbmods; Sep 30 '07, 02:57 PM. Reason: Added CODE tags.
  • pbmods
    Recognized Expert Expert
    • Apr 2007
    • 5821

    #2
    Heya, kujtim. Welcome to TSDN!

    Changed thread title to better describe the problem (did you know that threads whose titles do not follow the Posting Guidelines actually get FEWER responses?).

    Please use CODE tags when posting source code:

    &#91;CODE=javas cript]
    JavaScript code goes here.
    &#91;/CODE]

    Comment

    • acoder
      Recognized Expert MVP
      • Nov 2006
      • 16032

      #3
      Instead of using an absolute path to a local file, use a relative path to the ajaxlib.js source file.

      Comment

      Working...