javascript - jquery appends images to the end of the list and only displays plain text
高洛峰
高洛峰 2017-05-19 10:26:47
0
1
531
         function shua(){
                
                var str = ""; 
                
                var tbody=window.document.getElementById("table1");  

                var next=$("#number").html();

                var url = "\"  __ROOT__/index.php/Home/Index/play?id=";
                
                $.post(
                    
                    '__ROOT__/index.php/Home/Actor/shua',

                    {next:next,genresid:{$genresid}},
                    
                    function(msg){
                        var data = msg.data;  
                          var url="\"__ROOT__/index.php/Home/Index/video?id=";
                    for (i in data) {  
                        str +=   "<tr>" + 
                          
                        "<td><a href=" + url + data[i].id + "\"><img src=" + data[i].cover +" /></a></td>" +

                        "</tr>"
                        ;  
                    }  
                    
                     tbody.append(str);

                      $("#number").text(msg.next);
                   
                    }
                )
            }

Appending at the end of the list is indeed in text format, and the picture is not displayed.

高洛峰
高洛峰

拥有18年软件开发和IT教学经验。曾任多家上市公司技术总监、架构师、项目经理、高级软件工程师等职务。 网络人气名人讲师,...

reply all(1)
曾经蜡笔没有小新

$("#number").text(msg.next); -> $("#number").html(msg.next);

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template