function search_policy_archive_result_insert() { let kwd=""; let category=""; if(document.getElementById("kwd")) { kwd=document.getElementById("kwd").value; } if(document.getElementById("category")) { category=document.getElementById("category").value; } if(category!="total") return false; kwd=kwd.replace(/(<([^>]+)>)/ig,""); kwd=kwd.trim(); if(!kwd) return false; $.ajax({ type : "get", url : "./api/search_policy_archive_api.jsp", dataType : "json", data : "kwd=" + (encodeURI(kwd)), success : function(data) { if(data) { let is_mobile=false; if(document.getElementById("historyForm") && document.getElementById("historyForm").getAttribute("action").indexOf("msearch")!=-1) { is_mobile=true; } let div_lst_type_wrap = document.createElement('div'); div_lst_type_wrap.className="lst-type-wrap"; let dl_lst_type_a; let h3=document.createElement('h3'); let more_div = document.createElement('div'); more_div.className="section-btn more"; more_div.innerHTML="서울 정책 아카이브 더 보기"; if(is_mobile) { dl_lst_type_a = document.createElement('ul'); }else { dl_lst_type_a = document.createElement('dl'); } dl_lst_type_a.className="lst-type-thumb"; index_i=1; for(let key in data) { let title=data[key]["TITLE"]; if(title=="") continue; let dd; let hashtag=data[key]["HASHTAG"]; let thumb_url="https://www.seoul.go.kr/upload/policy/images/"+data[key]["STORED_FILE_NAME"]; let thumb_alt=title+" 썸네일 이미지"; let link_url="https://www.seoul.go.kr/policy/view.do?id="+data[key]["ID"]+"&lan=KO"; let mod_date=data[key]["MODIFIED_AT"]; let description=data[key]["DESCRIPTION"]; //강조 하이라이트 title=title.replaceAll(kwd, ""+kwd+""); description=description.replaceAll(kwd, ""+kwd+""); hashtag=hashtag.replaceAll(kwd, ""+kwd+""); if(is_mobile) { dd = document.createElement('li'); dd.innerHTML="\ \ "+title+"\ \ \""+title+"\"\ \ "+mod_date+"\ "+description+"\ "+hashtag+"\ \ \ "; }else { dd = document.createElement('dd'); dd.innerHTML="\
\
\ \""+thumb_alt+"\"\
\
\
\ "+title+"\ \ "+mod_date+"\ \
\
\ "+description+"\
\ \
\
"; } if(index_i<=3) { dl_lst_type_a.appendChild(dd); }else{ return true; } let location_num=search_policy_archive_result_location(); h3.innerHTML="서울 정책 아카이브"; div_lst_type_wrap.appendChild(h3); div_lst_type_wrap.appendChild(dl_lst_type_a); let obj_length=obj_lst_type_wrap_list.length; if(obj_length==0) return false; obj_lst_type_wrap_list[0].parentNode.insertBefore(div_lst_type_wrap, obj_lst_type_wrap_list[location_num]); index_i++; div_lst_type_wrap.appendChild(more_div); } } } , error: function(jqXHR, textStatus, errorThrown) { //console.log(jqXHR.responseText); } }); return true; } function search_policy_archive_result_location() { obj_lst_type_wrap_list=document.querySelectorAll('.lst-type-wrap'); let obj_length=obj_lst_type_wrap_list.length; if(obj_length==0) return false; location_num=0; for(let i=0;i