URL problem in ajax
hi
I m using ajax to retrieve data from a database. I know the syntax for the .open() function is
httpreq.open("GET",url,true);//httpreq is my variable
now in the data retrieving part, it goes into a status 404 that means file has not been found.
var url="/opt/sun/domains/domain1/docroot/get_details.jsp";
This is how i specified my URL. I m on a linux machine. I provided the ful path of the Jsp file. And i run the html file by putting
http://localhost:8080/employee_details.html
so it is connecting to the java application server. So y is it entering the 404 status. Do i have to specify something else in the var url?..
sorry for these newbie questions, but I thot this is the best place to ask fr problems.
if(httpreq.readyState==4)//state 4 means server is ready for requests.
{
alert("Connected to server and its ready for requests");
if(httpreq.status==200)//everything is OK
{
var response = httpreq.responseText;
alert("repsonse looks like this : " + response);
document.getElementById('myDiv').innerHTML=response;
}
elseif(httpreq.status == 404)
{
alert("SORRY URL DOES NOT EXIST!");
}

