> So, what I tried to do first is to put the script to a separate page, > then tried to use a "document.write(result);", so the PHP function can > use the fopen(), read the page contents and trim if necessary, but for > some reason, document.write() just doesn't want to spit that out to > the page.. I've also tried println() and writeln() - doing it with a > normal string is ok..
Well, no it wouldn't work. Try to grasp that php runs at the server ; the server opens mypage.php or whatever, runs any bits of php, outputs any bits of html to the client, runs the next bit of php if any that it finds, and so on. Finally the server comes to the end, and php execution is finished. Then, all the text that has been output gets sent to the client's browser for interpretation. The browser displays any html it finds, runs any javascript it finds, etc etc. And that's it. There is no way that php can ever read back part of page that's been modified in the browser - it's in a completely different environment, and in any case php execution is finished before the client does anything at all. You can of course write javascript that sends results to some php script ; that php script can then 'do things' with the results without sending any new html page to the client, but it could send data in the form of text, XML, JSON, blah. You can write javascript that listens for data results sent back from that php script, and the carry out some more actions at the client end - update the screen, do yet more sums, wait for the user to press a button, whatever. That's the basis of AJAX which sounds like it will do what you want. Not a maps issue. cheers, Ross K --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Google Maps API" 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 -~----------~----~----~----~------~----~------~--~---
