'+listData[i].channel.name+'

'+listData[i].title+'

'+listData[i].releaseTime.substring(0,10)+'

' var searchRow = $(html) searchRow.appendTo($('#searchList2')) } }else{ //$('.loading').hide(); $('.loading').text('暂无搜索内容') $('.noSearch').show(); $('#keywords').text($('#keyword').val()); $('#totalElements').text('0'); } $('.keywords').highlight($('#keyword').val()); }) }else{ myMessage.add('已经最后一页了', 'warning'); } } // 搜索按钮 function toSearch(){ page =1 last = false channelIds = '2326' $('#searchList2').empty(); search() getChannelList() } $("#keyword").keypress(function (e) { if (e.which == 13) { toSearch() } }); function upHot(hot){ $('#keyword').val(hot) toSearch() } $('.selectTime').on('click',function(){ console.log(111); $('.selectTime').removeClass("active-red") $('.assignTime').removeClass("active-red") $('#date').val("") this.classList.add("active-red") if($(this).index()==1){ releaseTimeBegin='' releaseTimeEnd='' } else if($(this).index()==2){ releaseTimeBegin=getData(30) releaseTimeEnd=getData(0) }else if($(this).index()==3){ releaseTimeBegin=getData(365) releaseTimeEnd=getData(0) } assign=false; page =1; last = false; $('#searchList2').empty(); search(); //getChannelList() }) $('.assignTime').click(function(){ $('.selectTime').removeClass("active-red") this.classList.add("active-red") }) $(document).ready(function(){ $('.tree-set').click(function(){ $('.tree-set').removeClass("active-red") this.classList.add("active-red") }) }); function getChannelId(id){ channelIds=id page =1 last = false $('#searchList2').empty(); search() } $(function(){ if(getUrlArg('q')){ $('#keyword').val(decodeURI(getUrlArg('q'))) // search() //getChannelList() }else{ //search() //getChannelList() } if( !('placeholder' in document.createElement('input')) ){ // 匹配 除type=password以外所有input、textarea $('input[placeholder][type!=password],textarea[placeholder]').each(function(){ var self = $(this), text= self.attr('placeholder'); // 如果内容为空,则写入 if(self.val()===""){ self.val(text).addClass('placeholder'); } // 控件激活,清空placeholder self.focus(function(){ if(self.val()===text){ self.val("").removeClass('placeholder'); } // 控件失去焦点,清空placeholder }).blur(function(){ if(self.val()===""){ self.val(text).addClass('placeholder'); } }); }); } }); // 获取日期 function getData (dayNum) { var myDate = new Date() var lw = new Date(myDate - 1000 * 60 * 60 * 24 * dayNum)// 最后一个数字多少天前的意思 var lastY = lw.getFullYear() var lastM = lw.getMonth() + 1 var lastD = lw.getDate() var startdate = lastY + '-' + (lastM