...

View Full Version : pls check my syntax is ok



afridy
09-02-2008, 01: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) {
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>

afridy
09-02-2008, 01: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.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum