here is my codeee ......
testest.html :
/////////////////////////////////////////////////
Expand|Select|Wrap|Line Numbers
- <html>
- <head>
- <title>Testing AJAXLib</title>
- <script type = "text/javascript" src = "D:\AJAX\LIBRA\complete\step8\ajaxlib.js"></script>
- <script language = "javascript">
Expand|Select|Wrap|Line Numbers
- function decodeXml()
- {
- var options = resultXML.getElementsByTagName("options");
- var loopIndex;
- var div = document.getElementById('targetDiv');
- div.innerHTML = "The first color is " +
- options[0].firstChild.data;
- }
Expand|Select|Wrap|Line Numbers
- </script>
- </head>
- <body>
- <H1>Testing AJAXLib</H1>
- <form>
- <input type = "button" value = "Display Message"
- onclick = "loadXMLDoc('options1.php', decodeXml, false)">
- </form>
- <div id="targetDiv">
- <p>The fetched data will go here.</p>
- </div>
- </body>
- </html>
and options1.php code is here
//////////////////////////////////////////////////
Expand|Select|Wrap|Line Numbers
- <html>
- <head>
- <title></title>
- </head>
- <body>
Expand|Select|Wrap|Line Numbers
- <?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>';
Expand|Select|Wrap|Line Numbers
- ?>
- </body>
- </html>
i also have problem using otherr ajax framework's pleasee help