Sir
i want to access the client localhost from the server jsp page using ajax application.But when i give the url eg:url="htpp://localhost:8080/Login/test.jsp" and i am running the tomcat in the client side an error displays that "Permission Denied"
i also give ip address which is dynamic but the same error.But i tried this from client to server i can access the server(static ip) page Please help me
My Code Is Like this
-----------------------------------------------------------------------------------------------------
<html>
<head>
<script language="Javascript">
function postRequest(strURL) {
var xmlHttp;
if (window.XMLHttpRequest) {
var xmlHttp = new XMLHttpRequest();
} else if (window.ActiveXObject) {
var xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
}
xmlHttp.open('POST', strURL, true);
xmlHttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
xmlHttp. {
if (xmlHttp.readyState == 4) {
updatepage(xmlHttp.responseText);
}
}
xmlHttp.send(strURL);
}
function updatepage(str){
document.getElementById("result").innerHTML =
"<font color='red' size='5'>" + str + "</font>";;
}
function showCurrentTime(){
var url="http://localhost:8080/Login/test.jsp";
postRequest(url);
}
</script>
</head>
<body>
<h1 align="center"><font color="#000080">Ajax Example</font></h1>
<p><font color="#000080">
<form name="f1">
<p align="center"><font color="#000080"> <input value=" From Server "
type="button" name="showdate"></font></p>
<div id="result" align="center"></div>
</form>
<div id=result></div>
</body>
</html>
----------------------------------------------------------------------------------------------------------
anyone can help me.is there any other way i can access a client jsp page using ajax application plz give me an example .client is also runing the tomact application and the target file is in the client machine