Click here to Skip to main content
15,748,615 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have written following code
<script type="text/javascript" language="javascript">
       function GetHttpRequestObject() {

               xmlhttp = new XMLHttpRequest();

               if (xmlhttp != null) {

         "Get", "../Book.xml", true)

               else {

                   alert("not created");




i have Book.xml file at root .
when i am running this code i am getting blank alert message, but i think it should show values written in xml. please help me out here
Updated 2-Aug-11 18:51pm

1 solution

if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari
           xmlhttp = new XMLHttpRequest();
       else {// code for IE6, IE5
           xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
       xmlhttp.onreadystatechange = function () {
           if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
               message1.innerHTML = xmlhttp.responseText;
       }"GET", "../Book.xml", true);

Try it...
Share this answer
spydeehunk 3-Aug-11 1:06am    
not working still m getting the alert message Empty
Pravinjas 3-Aug-11 1:16am    
in my code instead of message1.innerhtml take alert message.
dont take alert message bellow ur file call.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900