Looks to me liek you're not actually askign the XMLHttp to do anything.
onreadystatechange function. Maybe you don't need that and the open
command does it just fine with GET, I dunno...
> hi all
> i am new to this group can u help me with this code it is returning
> XMLHttpRequest status = 0 and due to this the data from a file is not
> being fetched iam pasting the code below
> <head>
> <title>Ajax at Work</title>
> <script language="javascript">
> //ajax request function
> var XMLHttpRequestObject=false;
> if(window.XMLHttpRequest)
> {
> // Opera 8.0+, Firefox, Safari
> XMLHttpRequestObject=new XMLHttpRequest();
> }
> else if(window.ActiveXObject)
> {
> //Internet Explorer
> XMLHttpRequestObject=new ActiveXObject("Msxml2.XMLHTTP");
> }
> else
> {
> alert("Your Browser is not compatible");
> }
> //function to get the data from the text file
> function getData(datasource,divID)
> {
> if(XMLHttpRequest )
> {
> var obj=document.getElementById(divID);
> XMLHttpRequestObject.open("GET",datasource,true) ;
> XMLHttpRequestObject.onreadystatechange=function()
> {
> if(XMLHttpRequestObject.readyState==4 )
> {
> alert(XMLHttpRequestObject.status);
> obj.innerHTML = XMLHttpRequestObject.responseText;
> }
> }
> }
> }
> </script>
> </head>
> <body>
> <H1>Welcome to Gift Selection</H1>
> <img src=images\titanic.jpg
> onmouseover="getData('text/titanic.txt','targetDiv')">
> <img src=images\watch.jpg
> onmouseover="getData('text/watch.txt','targetDiv')">
> <div id="targetDiv">
> <p>Select the Picture to get the discription</p>
> </div>
> ///////////////////////////////////////
> the data in titanic.txt n watch.txt can be anything, it just has to
> retrive the data from the file n display in the same page
thanks all but the problem is now resolved and without any webserver
the code is working in a html page only .........