Vote count:
0
I can't get the jQuery.ajax call to use my PHP string variable $defaultTicker. I have tried encoding to utf8 and trimming any type of "special" characters, yet nothing has helped. If I view the page source, I see a valid JSON array: { "ticker":"SPY", "startDay":1, "endDay":30}.
Here is my jQuery to submit the data:
$.ajax({
url: "findCorrelated.php",
// WHY DOESN'T <?=$defaultTicker?> work???
data: { "ticker":"<?=$defaultTicker?>", "startDay":1, "endDay":30},
success: function(data){
$('#testParagraph').show();
$('#testParagraph').html(data);
}
});
Any ideas as to why it is failing to submit using the PHP variable? If I hardcode "SPY" in place of "", it will succeed. However, when viewing the source, the results appear to be the same.
Note: I am not using json_encode on a php array, because the startDay and endDay values are going to come from the client-side javascript.
asked 21 secs ago
Aucun commentaire:
Enregistrer un commentaire