I would like to pass this JavaScript variable:
var dateString = $('input[name="date"]').val() ;
On the JSON get code below:
$.getJSON('DisplayMap.php', {runDate1 : dateString}, function(data) {
for (var i in data.b) {
output.push(new google.maps.LatLng(data.b[i].Ya, data.b[i].Za));
}
alert(output);
});
It seems json will accept this : {runDate1 : '2013-01-06'}
But not when its pass through a variable like this {runDate1 : dateString}
{runDate1 : dateString}
is an object literal. What exactly makes you think that it does not work? You already asked a couple of questions around this and the responses so far should have helped. If they didn't then you really have to explain what the problem is, otherwise you will get the the same answers every time. – Felix Kling Jan 9 '13 at 12:57DisplayMap.php
... no JSON in sight. You'll end up withDisplayMap.php?runDate1=[dateString]
– Matt Jan 9 '13 at 12:58