The AJAX Philosophy
The fundamental philosophy of AJAX is to load the static parts of your webpage only once, and request a small amount of information about the bits that change from a server. This makes changing the displayed data much faster.
My new website does have PHP, so this example now uses it. Clicking the [A], [B] and [C] buttons causes the current markers to be cleared and a fresh set of information to be loaded from the corresponding XML file.
Here’s what the source of the PHP server script looks like PHP script, and here’s the server script actually running: map11.php?q=a, map11.php?q=b, map11.php?q=c.
Here’s a really simple PHP script that reads this data file, finds the marker that’s “nearest” to the ?lat= &lng= parameters that are passed in the URL, and outputs the data as XML. [Somebody with more experience in PHP could probably write it a lot better than that].
Here’s that script in action map11a.php?lat=43.85&lng=-79.1
You can see the difference by reloading the example page, instead of clicking on the [A] icon.