title: passing the latitude and longitude to my map script
body: <p>I show the user address in the google map by using the latitude and longitude. I got the lat &amp; long by using an java-script, and also have the map script. but I dont know how to combine them, Simply what I need is pass the lat and long into the show map script "function initialize()". this is my code:</p>
  
  <pre><code>&lt;script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"&gt;&lt;/script&gt;
  &lt;script type="text/javascript"&gt;
  var map;
  var geocoder;
  var centerChangedLast;
  var reverseGeocodedLast;
  var currentReverseGeocodeResponse;
  
  var geocoder = new google.maps.Geocoder();
  var address = "&lt;?php echo $address;?&gt;";
  
  geocoder.geocode( { 'address': address}, function(results, status) {
  
    if (status == google.maps.GeocoderStatus.OK) {
      var latitude = results[0].geometry.location.lat();
      var longitude = results[0].geometry.location.lng();
      //alert(longitude);
    } 
  });     
  
  function initialize() {
  
      var latlng = new google.maps.LatLng(latitude,longitude);
      var myOptions = {
          zoom: 10,
          center: latlng,
          mapTypeId: google.maps.MapTypeId.ROADMAP
      };
      map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
      geocoder = new google.maps.Geocoder();
  
      var marker = new google.maps.Marker({
          position: latlng,
          map: map,
          title: "My Location"
      });
  
  }
  
  &lt;/script&gt;
  </code></pre>