I’ve got these two pages. One echoes a JSON encoded array and the other uses the JQuery $.ajax syntax to access it. The code looks something like this:
Page 1
$array = blah blah
echo json_encode($array);
Page 2
function load(){
$.ajax({
url: 'json_array_file.php',
data: 'value=<?php echo $_GET["session"]; ?>',
dataType: 'json',
success: function(data) {
var idCurrent = data[0];
var idVideo = data[1];
var idSession = data[2];
var state = data[4];
//do stuff with variables
}
});
}
So the trouble I’m having is that I now need to access two arrays from the first page but I’m not sure what the syntax is to access that second array within the $.ajax function on the second page. Anyone know how?
On the PHP side:
On the jQuery side: