i have 4 strings in my application like this that i want to pass to my js file
$a1='[10,20,13,14]';
$a2='[17,15,14,16]';
$a3='[18,24,16,17]';
$a4='[15,54,18,27]';
echo $a1.",".$a2.",".$a3.",".$a4;
and my javascriptcode is
$.ajax({
type: "POST",
dataType: "json",
url: "loaddata.php",
success: function(data)
{
alert(data); //alert 15,54,18,27
}
});
i can get just $a4 string, and i can not get other string
how can i pass these 4 strings in php and set these 4 variables in javascript
thanks;
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…