$.ajax({
              url:'shujson.php',
              type:'get',
              dataType:'json',
              success:function(msg){
                //获取需要的数据
                var group = msg.data;
                //拼接字符串
                var str3 = '';
                //对数据做遍历,拼接到页面显示
                var oom=[]
                 ood=group.filter(function(age){ return age.switch != 1}).slice(0,5)
                 console.log(ood)
                 for(var i=0;i<ood.length;i++){
                        if (ood[i].switch==1){                      
                        }else{
                            str3 += `<div class="swiper-slide">
                             <a href="book.html"> <img src="${ood[i].bookimg}" alt=""> </a></div>`;
                      
                             
                        }
                    }

                    
                    
            
               
                $('#day').html(str3);             
            }
          });
Last modification:February 22nd, 2020 at 05:35 pm
如果觉得我的文章对你有用,请随意赞赏