var obj_lst_type_wrap_list; var searchmenu_result_compl; function searchmenu_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]+)>)/ig,""); kwd=kwd.trim(); if(!kwd) return false; $.ajax({ type : "get", url : "./api/search_menu_api.jsp", dataType : "json", data : "search=" + btoa(encodeURI(kwd)), success : function(msg) { if(msg) { let is_mobile=false; if(document.getElementById("historyForm") && document.getElementById("historyForm").getAttribute("action").indexOf("msearch")!=-1) { is_mobile=true; } var div_lst_type_wrap; var dl_lst_type_a; var dd; var dl; var dl_hidden; if(is_mobile) { div_lst_type_wrap = document.createElement('div'); h3 = document.createElement('h3'); dl_lst_type_a = document.createElement('ul'); dd = document.createElement('li'); dl = document.createElement('dl'); hidden_div = document.createElement('div'); hidden_dl = document.createElement('dl'); hidden_dl.id="hidden_dl"; div_lst_type_wrap.className="lst-type-wrap"; dl_lst_type_a.className="lst-type-a"; hidden_div.className="section-btn more"; hidden_dl.style.display="none"; }else { div_lst_type_wrap = document.createElement('div'); h3 = document.createElement('h3'); dl_lst_type_a = document.createElement('dl'); dd = document.createElement('dd'); dl = document.createElement('dl'); hidden_div = document.createElement('div'); hidden_dl = document.createElement('dl'); hidden_dl.id="hidden_dl"; div_lst_type_wrap.className="lst-type-wrap"; dl_lst_type_a.className="lst-type-a"; hidden_div.className="section-btn more"; hidden_dl.style.display="none"; } for( let i = 0; i < msg.length; i++ ) { if(msg[i]["remove_search_word"]) { console.log(msg[i]["remove_search_word"]); remove_cate(msg[i]["remove_search_word"], msg[i]["remove_cate"]); }else if(msg[i]["remove_new"]) { news_remove(msg[i]["remove_news"]); }else if(msg[i]["title"]) { let dt = document.createElement('dt'); dt.style.marginBottom="10px"; dt.innerHTML=msg[i]["depth"]+' > '+msg[i]["title"]+''; if(i<=5) { dl.appendChild(dt); }else{ hidden_div.innerHTML="메뉴명 검색 더 보기"; hidden_dl.appendChild(dt); } let location_num=searchmenu_result_location(); h3.innerHTML="메뉴명 검색"; dd.appendChild(dl); dd.appendChild(hidden_div); dd.appendChild(hidden_dl); dl_lst_type_a.appendChild(dd); 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; //console.log(obj); obj_lst_type_wrap_list[0].parentNode.insertBefore(div_lst_type_wrap, obj_lst_type_wrap_list[location_num]); } } } } , error: function(jqXHR, textStatus, errorThrown) { //console.log(jqXHR.responseText); } }); searchmenu_result_compl=true; return true; } function remove_cate(search_word, remove_cate) { let kwd; if(document.getElementById("kwd")) { kwd=document.getElementById("kwd").value; } kwd=kwd.replace(/(\s*)/g, ""); if(!kwd || kwd.indexOf(search_word)==-1) return false; 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