如何获取和显示图像

时间:2019-05-15 08:55:49

标签: javascript

我正在尝试使用下面的代码获取和显示图像,但是它不起作用。我的代码有什么问题?

dataList.getList = function(s_page,show_page){
        var haveData = null;
        $.post("jsoncars.php",{
            action:'list',
            page:s_page
        },function(response){
            if(response != null && response.data.length > 0){
                $(".pagination").removeClass("hidden");
                $(".show-list-data").removeClass("hidden");                     
      *.find("td:eq(0)").text(response.data[i].car_img).end()*//<---this images

1 个答案:

答案 0 :(得分:0)

dataList.getList = function(s_page,show_page){
    var haveData = null;
    $.post("jsoncars.php",{
        action:'list',
        page:s_page
    },function(response){
        if(response != null && response.data.length > 0){
            $(".pagination").removeClass("hidden");
            $(".show-list-data").removeClass("hidden");                     
  .find("td:eq(0) > img").attr("src","http://localhost/rentalcars/picup/"+response.data[i].ca_img).end()