Hey, I've recently started developing an online game, and I'm getting on pretty well. To prevent the page from reloading all the time, which is very annoying, I decided to use AJAX to update all the values on screen, whenever the user performs an action.
I use a table to display all the users "materials" and how much of each material they have. I'd like to update these individually, but I can't figure out how to do this. Do I assign the returned text into separate variables, or do I secretly update the whole page as one, re-writing the entire contents of the main div? If I re-wrote everything, I'm sure it would freeze for a second, wouldn't it?
So, if refreshing the entire div isn't a good idea (please answer ), how would I get the values from the database, to the place where it should be on screen?
Many thanks,
~XxDarthDexterxX
I use a table to display all the users "materials" and how much of each material they have. I'd like to update these individually, but I can't figure out how to do this. Do I assign the returned text into separate variables, or do I secretly update the whole page as one, re-writing the entire contents of the main div? If I re-wrote everything, I'm sure it would freeze for a second, wouldn't it?
So, if refreshing the entire div isn't a good idea (please answer ), how would I get the values from the database, to the place where it should be on screen?
Many thanks,
~XxDarthDexterxX