tags:

views:

42

answers:

1

Hi All,

xmlhttp.responseText and xmlhttp.readyState works fine with localhost but if i use IP address it is not returning values same as localhost.

    function getFilenames()
 {    
  xmlhttp=GetXmlHttpObject();
     if (xmlhttp==null)
     {
     alert ("Browser does not support HTTP Request");
     return;
     }
     var url="GetFileNames.php";
     xmlhttp.onreadystatechange=stateChanged;
     xmlhttp.open("GET",url,true);
     xmlhttp.send(null);
 }

 function stateChanged()
 { 
  if (xmlhttp.readyState == 4)
     {
   StringFileName = xmlhttp.responseText; 
     }
  else
  {
   StringFileName = null;
  }
 }

Regards Hemant

A: 

Check properly the path . We faced this situation earlier.

e.g.

//This path is for local
var url="http://" + location.host +"/path/some.aspx";


//This path is for DEV Server
var url="http://" + location.host +"/path.net/path/some.aspx";

Hope this helps

priyanka.sarkar