Showing content from database without page refresh
I had been working with some AJAX functions and PHP recently. And right now i am building a web application where I need to update the database and then show that entry immediately in the same page without a page refresh,
Say for example, I will be showing a page with list of members and a small add button would be available on top of the page. when the user clicks on this "Add" button, he would be requested to enter the userdetails(This is actually shown as a DIV). After he enters the userdetails and clicks on submit button, he should be shown the list of users page with this new entry as well without a page refresh.
and so on. when you need to start removing and re-ordering the display of the members, it gets more complicated, but if you get to that point you start dealing with the parent node:
var member=document.getElementById("member_3");//or whatever the div id is to remove
do NOT simply say:
not only do you still have those in your DOM but you'll see funny rows of space left in their place. this is important when you start using ^ and \/ keys to move them up and down a list
Re: Showing content from database without page refresh
Basically you dont want to (show in the same div). You want to create a new div in the background, then remove the old div and insert the new one at the same location.
TheCPUWizard is a registered trademark, all rights reserved. (If this post was helpful, please RATE it!)
2008, 2009 In theory, there is no difference between theory and paractice; in practice there is.
* Join the fight, refuse to respond to posts that contain code outside of [code] ... [/code] tags. See here for instructions
* How NOT to post a question here
* Of course you read this carefully before you posted
* Need homework help? Read this first