0

I have a page which, when a user visits it, makes a MySQL call to a DB, and then puts that information into an html table presented to the viewer by the time the page initially loads.

I want to allow more advanced refinement options, like filtering by name, age, etc.

when the user submits their refinement options, how would I clear out the "old" data in the HTML table that is displayed on page load, and then re-populate it with the "new" data PHP returns?

Will this require DOM manipulation via JS? How can I specify the target node to echo out my PHP into?

Thanks :)

3
  • 1
    It sounds like you want to use AJAX to gather new information from the database and remake the table with new results. Is this right? Commented Jul 23, 2012 at 18:17
  • @Biotox: Yes! That's exactly it. Sorry I did not know the term. Do you know of any good getting-started resources for AJAX? Commented Jul 23, 2012 at 18:22
  • 1
    If you know/use jQuery, they have easy .ajax() function. You can just Google "jquery ajax" and find the API for it. w3schools.com also has a tutorial/basics for AJAX. Commented Jul 23, 2012 at 18:25

3 Answers 3

1

When the data you wish to display is available from a server and is not yet in the browser, you can make a AJAX call to go to the server and pull the data back from it for display.

A common use case for this is when you are displaying live information which could be periodically updated

What is ajax?

Want to start learning ajax?

Sign up to request clarification or add additional context in comments.

1 Comment

Thank you for providing links, they have gotten me off to a great start! :)
0

Dynamic java script will help you to incorporate the changes into html page.

AJAX will be the best solution to do this.

Comments

0

Ajax, Yes, document.getElementById

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.