View Full Version : pls check my syntax is ok

09-02-2008, 02:13 PM
hai friends,

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

<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) {
"<?php echo $newcity; ?>",
function(point) {
if (!point) {
alert(address + " not found");
} else {
map.setCenter(point, 13);
var marker = new GMarker(point);
marker.openInfoWindowHtml("Massachusetts - Ma ");



09-02-2008, 02:21 PM
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.