I am using JSON in PHP, and now I need to access it from JavaScript. How do I pass a JSON object to JavaScript?
<?php
$array = array("a"=>"Caucho", "b"=>"Resin", "c"=>"Quercus");
$json = json_encode($array);
>
where My.js has:
showAll(){
alert("Show All Json Objects");
// How do I get the JSON value here?
}
How can I do it?