PageSourceSearch

https://store.kai-group.com/js/usr/redirect_category.js

js kai-group.com collected 2026-09-24 17:55:19 UTC 1,163 bytes, 30 lines download raw bytes

1// ページ全体(画像や他のJS含む)が完全に読み込み終わってから確実に実行させる
2window.addEventListener('load', function() {
3  
4  // 1. 遷移先のマッピング設定
5  var redirectMap = {
6    '包丁': '/shop/c/c1003/',
7    'ほうちょう': '/shop/c/c1003/'
8  };
9
10  // 2. フォームの送信イベントを監視(jQueryを使用)
11  jQuery(document).on('submit', 'form[name="frmSearch"]', function(event) {
12    
13    var keyword = jQuery('#keyword').val();
14    if (!keyword) return;
15    
16    // 入力されたキーワードの前後のスペースを削除
17    var cleanKeyword = keyword.trim();
18
19    // 「包丁」または「ほうちょう」に一致した場合
20    if (redirectMap[cleanKeyword]) {
21      // 本来の検索処理(サーバー送信)をその場で即座に差し止める
22      event.preventDefault(); 
23      event.stopPropagation(); // 他のJS(サジェスト等)へのイベント伝播もストップ
24      
25      // 指定された包丁カテゴリページへリダイレクト
26      window.location.href = redirectMap[cleanKeyword];
27    }
28  });
29
30});

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.