Action to json stops jquery action
I am pulling locations from a datatable via microsoft sql. The script is below. It work fine on my development machine. When I move it to the webserver it stop executing at:
var markers = JSON.parse('<%=GetLocations()%>');
<script type="text/javascript">
function initialize() {
var mapOptions = {
center: new google.maps.LatLng(44.87431, -93.17217),
zoom: 10,
myTypeId: google.maps.MapTypeId.ROADMAP
};
var infoWindow = new google.maps.InfoWindow();
var map = new google.maps.Map(document.getElementById("map_canvas"), mapOptions);
var markers = JSON.parse('<%=GetLocations()%>');
for (i = 0; i < markers.length; i++) {
var data = markers[i]
var myLatLng = new google.maps.LatLng(data.fldLatitude, data.fldLongitude);
var marker = new google.maps.Marker({
position: myLatLng,
map: map,
title: data.fldCrewName
});
(function (marker, data) {
google.maps.event.addListener(marker, "click", function (e) {
infoWindow.setContent(data.Description);
infoWindow.constructor(map, marker);
});
})(marker, data);
}
};
google.maps.event.addDomListener(window, 'load', initialize);
</script>
this line:
var markers = JSON.parse('<%=GetLocations()%>');
stops the script.
I have the Json text dumping to an asp.textbox and there is information being return; however, I have no idea why as script is stoping.