Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Sep 2008
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    pls check my syntax is ok

    hai friends,

    i have put a piece of php in js,
    please verify and tell it is ok or not.
    thank you.

    Code:
        <script type="text/javascript">
    
        var map = null;
        var geocoder = null;
    
        function initialize() {
          if (GBrowserIsCompatible()) {
            map = new GMap2(document.getElementById("map_canvas"));
            map.setCenter(new GLatLng(37.4419, -122.1419), 13);
            geocoder = new GClientGeocoder();
          }
    	        if (geocoder) {
            geocoder.getLatLng(
              "<?php echo $newcity; ?>",
              function(point) {
                if (!point) {
                  alert(address + " not found");
                } else {
                  map.setCenter(point, 13);
                  var marker = new GMarker(point);
                  map.addOverlay(marker);
                  marker.openInfoWindowHtml("Massachusetts - Ma ");
                }
              }
            );
          }
    
        }
    
    
        </script>

  • #2
    New to the CF scene
    Join Date
    Sep 2008
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts
    yah friends,
    i just found the problem that y my above php script does not work.
    coz php already processed while calling that js function.

    so i just planning to print the php value in to hidden text box and get that from js.
    hope this will be alright.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •