哪位有这方面的例子?最近急需这方面的材料

解决方案 »

  1.   

    test.php
    <?php
    exit(json_encode(array('i1'=>'1','i2'=>'2',)));
    jquery ajax请求
    $.getJSON(
      "test.php",
      function(json){
        alert("JSON Data:   " + json.i1);
      }
    );  具体的详细的可以查看jquery手册
      

  2.   

    test.php
    <?php
    exit(json_encode(array('i1'=>'1','i2'=>'2',)));
    jquery ajax请求
    $.getJSON(
      "test.php",
      function(json){
      alert("JSON Data: " + json.i1);
      }
    );