On Oct 19, 2:59 pm, Kyle Parrish <[email protected]> wrote: > > It works ok when I run it in Chrome, but reverts in IE and actually > fails completely in Firefox, I don't know if it is something that I > am doing that is causing the map to refresh or not. > > You can view the page here:http://vgi.unl.edu.
A page resetting is a symptom of using document.write() after it's finished loading. And in fact this is what you are doing. Your AJAX request to http://vgi.unl.edu/jax/search.php?search=boston returns a fully-formed HTML page, complete with <script> references to the Maps API and your Javascript files. When you inject that into your sidebar, the browser loads the API again, and that includes a document.write to load the full Maps API. That resets the page. You need to alter that PHP script so that it returns *only* what is required for the sidebar. No <html>, <body> or whatever: *just* the content of the target div. I believe it works in Chrome because Chrome ignores the extraneous <head> element you are introducing. That's what contains the API loader script, so it never gets run. The other two fall over in a heap because you're re-loading the page and various things are either not being done or being done slightly out of sync, which is why their behaviour differs. Rule 1 when using AJAX: always test the values you are fetching. -- You received this message because you are subscribed to the Google Groups "Google Maps API V2" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/google-maps-api?hl=en.
