I am not sure the best way to go about this, basically I have a JSP page that returns a set of results (a list of employees) in HTML from a MySQL database. Using a loop, each item is returned and formated into a link. Eg.
<a href="details.jsp?emp=\"" + resultSet.getString(1) + "\"/>"
Therefore each link will allow a user to load a page that will display the details of the selected employee.
I now want to improve this. I have a div on the results page that I would like to populate with the employee details instead of opening a new link. My problem is, I do not know how to go about this using jQuery. I have looked at .load() but that seems to only work with a predefined address and when using .click(#div_id), how could jQuery know what employee details to load?
Sorry if this is a simple question, but I am still learning. Can anyone suggest where I should look or how I could go about this?
1 Answer