Hey i sent a JSON encoded array to my JS page with two links.
{"download":"http://JapSeyz.dk/Test/Medarbejder/fileDownload.php?filename=test___1847598251_26-04-2013.png","view":"http://JapSeyz.dk/Test/Medarbejder/uploads/test___1847598251_26-04-2013.png"}
that is the output
it is in the array called status and if i try status[download] it is undefined, and status[0,1,2] and so on, just gives me a single character.... How do i select the whole link from download at once?
Thanks :)
Heres all the code.. Sorry (Some danish text, but i just want to display a Force DL link and a view link)
var links = JSON.parse(status);
var download = status.download;
var view = status.view;
var status = "Brug dette link hvis folk kun skal se dette <br /><div class='link-copy'>http://JapSeyz.dk/Test/Medarbejder/"+view+"</div><br /><br />Hvis du vil have folk til at downloade den skal du bruge dette link <br /> <div class='link-copy'>"+download;
//set the status message to that returned by the server
document.getElementById('status').innerHTML=status;
And the PHP:
$test = json_encode(array("download" => $link, "view" => "http://JapSeyz.dk/Test/Medarbejder/".$move));
echo returnStatus($test);