Hi All,

When we pass url in our ajax function calls, I want that url to be an absolute url.

For Eg: I have my ajax code wriiten in Javascript/ajax.js file
In this I pass the url say url=ajaxResponse.jsp?variable=var
My ajaxResponse.jsp file is in jsp folder.
When I call ajax function from ajax.js in /jsp/File1.jsp it works fine.
But if i call same ajax function in /jsp/Folder1/File2.jsp it gives me the error requested resource not found.Because it finds the file in the following path: /jsp/jsp/Folder1/ajaxResponse.jsp
So I want the url to be absolute. url=/jsp/ajaxResponse.jsp?variable=var

Please help me how can I do it.
Thanks in advance

You could keep your ajax response page in a common folder and append the path to the URL.
Like declare path = ../jsp/
URL=#path#ajaxResponse.jsp?variable=var
Iam not sure whether thats correct.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.