How to pass parameters to callback function in the initialization script

3,011 views
Skip to first unread message

John Mamuscia

unread,
Jul 6, 2011, 6:26:09 PM7/6/11
to google-map...@googlegroups.com
Using this sample below, how would I be able to pass parameters to the callback initialize script?  I would like to pass it 5 parameters as follows:
function initialize(ztype, zticketvar, zmonthname, zmfg, zmodel) { ... }
 
var script = document.createElement("script");
script.type = "text/javascript";
document.body.appendChild(script);

Ben Appleton

unread,
Jul 7, 2011, 12:21:14 AM7/7/11
to google-map...@googlegroups.com
Do you mean something like this?

function callback() {
  initialize(ztype, zticketvar, zmonthname, zmfg, zmodel);

}
var script = document.createElement("script");
script.type = "text/javascript";
script.src = "http://maps.google.com/maps/api/js?sensor=false&callback=callback";
document.body.appendChild(script);

- Ben
--
You received this message because you are subscribed to the Google Groups "Google Maps JavaScript API v3" group.
To view this discussion on the web visit https://groups.google.com/d/msg/google-maps-js-api-v3/-/MaVfWwRoVloJ.
To post to this group, send email to google-map...@googlegroups.com.
To unsubscribe from this group, send email to google-maps-js-a...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-maps-js-api-v3?hl=en.

Reply all
Reply to author
Forward
0 new messages