My question is, how can i make an ajax request from a page in sub directory and get its responce.
Here, My page index.jsp is placed inside a sub directory /vf2, inside it i have included the script file
<script src="../script/testscript.js"></script>
testscript.js
function getPlaceFromIP3(){
var ipAdd="1";
var params ="ipAdd="+ipAdd;
var resultStringX = $.ajax({
type: "GET",
url:"result_page.jsp",
data: params,
async: false
}).responseText;
alert(resultStringX);
}
The page result_page.jsp is included in the public_html directory itself.
When i invoke the function from index.jsp I am getting a page not found message. How could i send request to a page in the main directory from the sub directory.
And if it were a normal link how would you link to it? The same thing apply here. Use a proper relative url to the file. Start the URL from the root.
if the file is located at
http://www.example.com/result_page.jsp, it would be