쇼핑몰 검색어 저장

This commit is contained in:
이대환
2026-06-05 14:44:03 +09:00
parent 7bfa5a288c
commit 03ec9d863e
8 changed files with 105 additions and 0 deletions

View File

@@ -1286,6 +1286,13 @@
searches.shift(); // 6개를 초과하면 가장 오래된 검색어를 제거
}
localStorage.setItem('recentSearches', JSON.stringify(searches));
$.ajax({
type: 'post',
url: '<c:url value="/sopmal/goods/insertSrchwrdLog"/>',
data: { srchStr : param},
success: function () {}
});
}
}

View File

@@ -513,6 +513,13 @@
searches.shift(); // 6개를 초과하면 가장 오래된 검색어를 제거
}
localStorage.setItem('recentSearches', JSON.stringify(searches));
$.ajax({
type: 'post',
url: '<c:url value="/sopmal/goods/insertSrchwrdLog"/>',
data: { srchStr : param},
success: function () {}
});
}
}

View File

@@ -119,7 +119,15 @@
/* ********************************************************
* 목록 조회
******************************************************** */
let onload = true;
const fn_select_list = function (pageIndex, pageUnit) {
if(!onload) {
let kwrd = $('#listForm input[name="kwrd"]').val();
if(kwrd)
saveSearch(kwrd);
}
onload = false;
let dataStr;
if (!pageIndex) {
$('#pageIndex').val(1);