解决方案 »

  1.   

    用jquery appen 添加
    事件用click绑定
      

  2.   

    $("#fileBox").html('');
    var itemDom;
    $.each(result.msg.list,function(i,item){
      urlStr = "http://"+item.ipAddress+item.path;
      
      if(1==item.typeCode){//图片类型
        itemDom = $("<li class='imgItem><img src='"+urlStr+"'/><div class='imgInfo'></div><p>"+item.fileName+"</p></li>");   
      }else if(2==item.typeCode){//视频类型
        itemDom = $("<li class='imgItem'><img src='images/icon_vdeio.png'/><div class='imgInfo'></div><p>"+item.fileName+"</p></li>");
      }
      itemDom.click = function(){
        selectFile(item.fileInfoId+,item.fileName,urlStr);
      }
      $("#fileBox").append(itemDom);
    });//设置分页
    $("#START_PAGE").val(result.msg.pageNum);
    $("#PAGE_SIZE0").val(result.msg.pageSize);
    $("#AMOUNT").html(result.msg.total);
    $("#START_PAGE1").html(result.msg.pageNum+"&nbsp;");
    $("#PAGE_COUNT").html(result.msg.pages+"&nbsp;");
    $("#PAGE_SIZE1").html(result.msg.pageSize);$("#xiye").html(result.msg.pageNum);
    $("#mo").html(result.msg.pages);append吧
      

  3.   

    书写要规范,onclick把引号加上。