可以';t获取使用Jquery Ajax生成的记录/行的详细信息


Can't Get Detail of a Record/Row Generated uding Jquery Ajax

我使用jquery和codeigniter,编写的代码使用.ajax-json生成结果,并将结果显示在名为"结果表"的div中。然后,根据结果,我想使用相同的方法执行另一个查询,以获得每一行的详细信息(通过单击每一行触发)。下面的代码似乎可以获得参数(assetid),但它不能再次向同一个div"result table"显示结果。简而言之,我想获得第一个AJAX查询产生的各个行的详细信息。。AJAX之后的AJAX。。对不起我的英语。

//this function - when user click on a row...it will perform another query using ajax json..and display the result in div id=result_table
$('#getassetinfo').live('click', function() {
 assetid=$(this).attr("id_hm");
$.ajax({
        url: '<?php echo base_url().'index.php/amx/get_asset_info_json/';?>'+ assetid,
        type:'POST',
        dataType: 'json',
        success: function(output_string){
                $('#result_table').append(output_string);
            } 
        }); // End of ajax call 

});

感谢

这里有错误:如果你有firebug,请在控制台面板上仔细检查

url: '<?php echo base_url().'index.php/amx/get_asset_info_json/';?>'+ assetid,

这应该解决它:

url: '/index.php/amx/get_asset_info_json/'+ assetid,