I have a game where navigation is based upon a grid. Where you are on the grid is highlighted with a different color then the rest of the grid which are simple white cells. There are two variables that will determine how big the grid is.
$totalcell = The total cells in the grid.
$totalcol = The columns in the grid
Then I run a while statement that shall echo out the grid. So if I had 24 cells and a $totalcol of 4 then I'd have 6 rows containing 4 cells on each row. Pretty simple. As for navigation, there are four arrows... up, down, left, right that determine where I go.
Here is the problem though with normal php, she loads far far too slow. On a grid of a 100 cells and I need to get something in the 8th row, those few extra seconds it takes to refresh the entire page becomes quite costly and annoying to say the least. When the form is posted after a user clicks what direction they want to go a variable of $rowid is posted. I then do an if statement and if the $rowid is equal to number of the loop as the while statement is looping, it echos out a different bg color for the grid.
So now with all of this buzz of ajax going around on how it can save me those few precious seconds where that visible refresh usually won't be noticeable and a user can automatically move up and down or side to side with much more ease. What exactly do I need to do to use a basic amount of ajax? These internet tutorials are confusing the heck out of me so as I did in the past I figured I'd ask here and learn about it.