window.addEventListener('load',function () { COMMON_INIT.scrollEvent(); var search = $('#search') $('.search-btn').click(function () { var val = search.val().replace(/\s/g,'') if(!val.length){ window.location.href = './search' }else { window.location.href = './search?keyword='+val } }) var hotSearchBox = $("#hotSearchList") jrs.getHotSearchPaper(function (res){ if (res.code == 200){ var data = res.data; var html = ""; for (var i in data){ var type = data[i].type,title = data[i].title,recordId = data[i].recordId,href; if (type && recordId){ if (type == "periodical") type = "journal" href = baseUrl+'/'+type+'/'+recordId+'.html' } else href = "#" html+='
  • '+title+'
  • ' } hotSearchBox.append(html); } }); $(document).keyup(function(event){ if(event.keyCode ==13){ $(".search-btn").trigger("click"); } }); })