[fix] 사이트 내 전체검색 > 검색어 양 끝의 공백 제거

This commit is contained in:
kjh
2022-10-05 11:50:08 +09:00
parent a21d02f4c5
commit 0f3e6125b5
10 changed files with 50 additions and 30 deletions

View File

@ -68,7 +68,8 @@ include_once(G5_LIB_PATH.'/popular.lib.php');
<script>
function fsearchbox_submit(f)
{
if (f.stx.value.length < 2) {
var stx = f.stx.value.trim();
if (stx.length < 2) {
alert("검색어는 두글자 이상 입력하십시오.");
f.stx.select();
f.stx.focus();
@ -77,8 +78,8 @@ include_once(G5_LIB_PATH.'/popular.lib.php');
// 검색에 많은 부하가 걸리는 경우 이 주석을 제거하세요.
var cnt = 0;
for (var i=0; i<f.stx.value.length; i++) {
if (f.stx.value.charAt(i) == ' ')
for (var i = 0; i < stx.length; i++) {
if (stx.charAt(i) == ' ')
cnt++;
}
@ -88,6 +89,7 @@ include_once(G5_LIB_PATH.'/popular.lib.php');
f.stx.focus();
return false;
}
f.stx.value = stx;
return true;
}

View File

@ -97,7 +97,8 @@ include_once(G5_LIB_PATH.'/popular.lib.php');
<script>
function fsearchbox_submit(f)
{
if (f.stx.value.length < 2) {
var stx = f.stx.value.trim();
if (stx.length < 2) {
alert("검색어는 두글자 이상 입력하십시오.");
f.stx.select();
f.stx.focus();
@ -106,8 +107,8 @@ include_once(G5_LIB_PATH.'/popular.lib.php');
// 검색에 많은 부하가 걸리는 경우 이 주석을 제거하세요.
var cnt = 0;
for (var i=0; i<f.stx.value.length; i++) {
if (f.stx.value.charAt(i) == ' ')
for (var i = 0; i < stx.length; i++) {
if (stx.charAt(i) == ' ')
cnt++;
}
@ -117,6 +118,7 @@ include_once(G5_LIB_PATH.'/popular.lib.php');
f.stx.focus();
return false;
}
f.stx.value = stx;
return true;
}

View File

@ -45,7 +45,8 @@ if ($stx) {
<script>
function fsearch_submit(f)
{
if (f.stx.value.length < 2) {
var stx = f.stx.value.trim();
if (stx.length < 2) {
alert("검색어는 두글자 이상 입력하십시오.");
f.stx.select();
f.stx.focus();
@ -54,8 +55,8 @@ if ($stx) {
// 검색에 많은 부하가 걸리는 경우 이 주석을 제거하세요.
var cnt = 0;
for (var i=0; i<f.stx.value.length; i++) {
if (f.stx.value.charAt(i) == ' ')
for (var i = 0; i < stx.length; i++) {
if (stx.charAt(i) == ' ')
cnt++;
}
@ -65,6 +66,7 @@ if ($stx) {
f.stx.focus();
return false;
}
f.stx.value = stx;
f.action = "";
return true;

View File

@ -31,7 +31,8 @@ add_stylesheet('<link rel="stylesheet" href="'.$search_skin_url.'/style.css">',
<script>
function fsearch_submit(f)
{
if (f.stx.value.length < 2) {
var stx = f.stx.value.trim();
if (stx.length < 2) {
alert("검색어는 두글자 이상 입력하십시오.");
f.stx.select();
f.stx.focus();
@ -40,8 +41,8 @@ add_stylesheet('<link rel="stylesheet" href="'.$search_skin_url.'/style.css">',
// 검색에 많은 부하가 걸리는 경우 이 주석을 제거하세요.
var cnt = 0;
for (var i=0; i<f.stx.value.length; i++) {
if (f.stx.value.charAt(i) == ' ')
for (var i = 0; i < stx.length; i++) {
if (stx.charAt(i) == ' ')
cnt++;
}
@ -51,6 +52,7 @@ add_stylesheet('<link rel="stylesheet" href="'.$search_skin_url.'/style.css">',
f.stx.focus();
return false;
}
f.stx.value = stx;
f.action = "";
return true;