Using PHP retrieved variables in Javascript

Posted by mouthpiec on Stack Overflow See other posts from Stack Overflow or by mouthpiec
Published on 2010-04-09T18:50:39Z Indexed on 2010/04/09 18:53 UTC
Read the original article Hit count: 313

Filed under:
|
|

Hi,

I will use the following javascript to display a Google Map Window in a webpage.

<script language = 'javascript'"> 
    function initialize() 
    {
      if (GBrowserIsCompatible()) 
      {
        var map = new GMap2(document.getElementById("map_canvas"));
        map.setCenter(new GLatLng(35.904173, 14.433396), 16);
        map.setUIToDefault();
      }
    } 
</script> 

I would like to read the coordinates from a db, to generate the map using PHP, but how is it possible to use the retrieved(eg $lat = xxx and $lon = yyy) values into the javascript?

© Stack Overflow or respective owner

Related posts about php

Related posts about JavaScript