Jump to content

Ajax Problem


sureshonpc

Recommended Posts

Hi am new to ajax.what,s the actual problem is am working on simple jsp project i dont have any back end process am writing jdbc connection and queries all with in jsp.here problem is in ajax (http.open("GET", url , true):) in the url place what i have to mention....?i dont have any backend process...please help me...i dont have any asp or php ...i have seen lot of examples everyone is giving asp or php examples.. :)

Link to comment
Share on other sites

As long as the resource is on the same domain as the page that is using AJAX, you can use it to get any file. For example, if you had an XML file on your website, you could put the URL to that xml file in your AJAX request and use the responseXML to deal with the response.If, however, you want to display dynamic data based on some parameters in a query string, you'll probably need to use a server side language. JSP works just as well as PHP or ASP in this regard. If you had a JSP page (let's call it userinfo.jsp) that would return information about a user if you passed it a userID, then you could do something like this:

var userID = 456;var url = "userinfo.jsp?userID=" + userID;http.open("GET", url, true);

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...