// 검색버튼 클릭시 function search_btn(){ $("#list_wrap").empty().append("
"); $("#search_field").val($("#keyword").val()); $("#search_word").val($("#searchWord").val()); read_news_list(1); return false; } /************************ IE 버전 체크 */ function get_version_of_IE () { var word; var version = "N/A"; var agent = navigator.userAgent.toLowerCase(); var name = navigator.appName; if ( name == "Microsoft Internet Explorer" ) word = "msie "; // IE old version ( IE 10 or Lower ) else { if ( agent.search("trident") > -1 ) word = "trident/.*rv:"; // IE 11 else if ( agent.search("edge/") > -1 ) word = "edge/"; // Microsoft Edge } var reg = new RegExp( word + "([0-9]{1,})(\\.{0,}[0-9]{0,1})" ); if ( reg.exec( agent ) != null ) version = RegExp.$1 + RegExp.$2; return version; } /*************************/ function read_news_list(pageNo) { /************************ ↓↓ Ajax URL 변경. */ var querystring if ((parseInt(get_version_of_IE(),10))>9 || get_version_of_IE() == "N/A"){ // IE 10이상 또는 기타브라우저시. querystring = "ntype="+$("#ntype").val()+"&natCd="+$("#natCd").val()+"&pageNo="+pageNo+"&pageSize="+$("#page_size").val()+"&search_Field="+$("#search_field").val()+"&search_Word="+escape($("#searchWord").val()); window.history.pushState("","",location.pathname+"?"+querystring); } /************************ ↓↓ Ajax 페이지 reload */ $("#list_wrap").empty().append(""); var param = {ntype: $("#ntype").val(), natCd: $("#natCd").val(), page_no: pageNo, search_Field: $("#search_field").val(), search_Word: $("#search_word").val(), pagesize: $("#pagesize").val()}; $.ajax({ url: "/service/fair/svc_bbs_list.asp", type: 'POST', data: param, dataType: 'json', async: true, //timeout: 3000, error: function(p_req, p_status, p_err) { //alert('ERR1'); alert("정보를 읽는 중 오류가 발생하였습니다. 잠시 후 이용바랍니다."); }, success: function(p_data) { var newsList = $("#list_wrap"); newsList.empty(); if (p_data.newsCnt <= 0) { newsList.append("검색 조건에 만족하는 글이 없습니다.
"); } else { for (var idx = 0; idx < p_data.newsList.length; idx++) { newicon = "" var datarec = p_data.newsList[idx]; var writedate = datarec.regdate.split("."); var Newday = new Date(writedate[0],writedate[1]-1,writedate[2]); var Today = new Date(); var btMs = Today.getTime() - Newday.getTime(); var btDay = btMs / (1000*60*60*24) ; if (btDay <= 3){newicon = " "} newsList.append("