lonewolf217 Posted May 25, 2009 Share Posted May 25, 2009 I am having a little trouble with something and I am not sure if I am doing it correctly, or if it is even possible. I have a simple php page that will query a database and return a list of items in a table which will be displayed in a div on the first page via an AJAX query. My question is basically, can I have another link within this div that will do another AJAX query to return changed data to the same div ? Say for example, in this list of items that were displayed in the table I wanted to sort them. Within this div I have a dropdown with a distinct list of categories that were returned. Can I have another query which will take the value of that dropdown and regenerate the list into the same div on the first page? If it is possible, would the javascript portion of the new AJAX query go on the original page, or on the backend page ? Quote Link to comment Share on other sites More sharing options...
trq Posted May 26, 2009 Share Posted May 26, 2009 Yes it is possible. Why would the second ajax part go on the backend page (which we assume to be server-side php) ? Quote Link to comment Share on other sites More sharing options...
lonewolf217 Posted May 26, 2009 Author Share Posted May 26, 2009 basically I want to have a link within the div populated by the initial AJAX query which will update the content of that div without refreshing the page. When I had initially tried this, any link that was generated by the backend page via AJAX query did not seen to recognize any javascript function that was on the front end page so I was wondering how it was supposed to be designed Quote Link to comment Share on other sites More sharing options...
Ken2k7 Posted May 26, 2009 Share Posted May 26, 2009 Read up on jQuery's tablesorter. No back-end queries needed for that. But if you want, you can use AJAX multiple times to query the DB multiple times. But I rather not waste DB resources. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.