On Sun, Mar 20, 2011 at 11:09 AM, Sandeep Samdaria < [email protected]> wrote:
> Hello friends, > > I am using jsp and Java for google maps. > Basically what i am trying to implement is that i will be calling a java > function,in jsp using javabeans.This function will return a Document object. > Now i have the xml content,which can be parsed in a jsp page. > > In,this tutorial : > http://code.google.com/apis/maps/articles/phpsqlajax_v3.html , we already > have a xml file which being parsed. > > can i use this Document object in place of *var xml = data.responseXML;* > > No. You're confusing server code (JSP and Java) with browser code (JavaScript). That "var xml = ..." statement is JavaScript. The Maps API is JavaScript. It runs in the browser and has no connection to your JSP and Java code. Your server code *generates* the JavaScript code and XML or JSON or other data sent to the client. So, in the process of generating that data, you can use any objects and features available in your server language. But JavaScript code doesn't run on your server. BTW I recommend using JSON instead of XML if you're generating data to send down to JavaScript code. It is *much* simpler to work with in JavaScript. It's unfortunate that Google still has that complicated XML example instead of a simple JSON example. -Mike -- You received this message because you are subscribed to the Google Groups "Google Maps JavaScript API v3" 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-js-api-v3?hl=en.
