【发布时间】:2010-10-02 09:34:10
【问题描述】:
我在 PHP 中使用 JSON,现在我需要从 JavaScript 访问它。如何将 JSON 对象传递给 JavaScript?
<?php
$array = array("a"=>"Caucho", "b"=>"Resin", "c"=>"Quercus");
$json = json_encode($array);
>
My.js 的位置:
showAll(){
alert("Show All Json Objects");
// How do I get the JSON value here?
}
我该怎么做?
【问题讨论】:
标签: php javascript ajax json