需要注意的是,html文本中的<>字符需要特别处理,示例如下:

function admin_data(){

$result_data['name'] ="NAME";

$result_data['content'] = $this->load->view('cont/game/game_search_v.php', $data, true);

$json=json_encode($result_data);
$myjson=strtr($json, array('<'=>'\u003C',">"=>'\u003E'));
echo $myjson;

}

jQuery代码:

   $("#link_data").click(function(){
       $.getJSON('/get_data', function(data){
           art.dialog({
                "title":data.name,
                "padding":15,
                "background": '#FFF',
                "content": data.content,
                "lock":true,
                "fixed":true
            });
       });

   });

 

相关文章:

  • 2021-08-25
  • 2021-10-01
  • 2022-02-19
  • 2022-12-23
  • 2021-12-25
  • 2021-11-20
  • 2021-07-16
  • 2021-09-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-08-30
  • 2021-09-18
  • 2022-12-23
  • 2021-09-10
  • 2022-12-23
相关资源
相似解决方案