请给出 javascript 代码,谢谢!!

解决方案 »

  1.   


    eval('('+json+')');你要问的是这个吗?
      

  2.   

    $s='{"forder":"tem",
    "page":"index.htm",
    "class":["w250","h260", "pdl20"]
    }';
    print_r(json_decode($s,true));
    echo json_encode(json_decode($s,true));
      

  3.   

    $.post("<?php echo site_url("admin/pm_set/get_row_brand")?>",
           {package_id:$("#pm_set_package_id").val()},
           function(data){
            var myjson='';
        
        eval('myjson=' + data + ';');  //应该就是这句了 //重设对应品牌的值.
    $("[name=brand_id]").each(function(i){
        $(this).attr("checked",false);
    for(t = 0;t<myjson.length;t++)
    {
       if(myjson[t].toString() == $(this).val().toString() )
       {
         $(this).attr("checked","checked");
       show_mobile_list($(this).val(),  $(this).attr("checked"),$(this).attr("brand_title") );

       }else {

       }
    }
     }); 
      } 
    );