PageSourceSearch

https://www.e-myholiday.com/js/st5/selectedDestinationArea.js?1742882655

js e-myholiday.com collected 2026-10-02 05:54:55 UTC 1,885 bytes, 54 lines download raw bytes

1// noinspection JSUnresolvedReference
2
3document.addEventListener('DOMContentLoaded', function () {
4  const buttons = document.querySelectorAll('.btn-select-destination');
5  const hiddenInput = document.getElementById('destinationCode'); // hidden の要素
6  const displayArea = document.getElementById('searchDestination'); // ホームの表示部分
7
8  // 保存された値を選択状態にする
9  const savedKey = getCookie('selectedDestinationKey');
10  const savedValue = getCookie('selectedDestinationValue');
11
12  if (savedKey && savedValue) {
13    // hidden に値をセット
14    hiddenInput.value = savedKey;
15
16    // ホームの表示部分にセット
17    displayArea.value = savedValue;
18
19    // ボタンの選択状態を更新
20    buttons.forEach(button => {
21      if (button.getAttribute('data-key') === savedKey) {
22        button.classList.add('active'); // 選択状態のクラスを追加
23      }
24    });
25  }
26
27  // ボタンをクリックした際の処理
28  buttons.forEach(button => {
29    button.addEventListener('click', function () {
30      const key = this.getAttribute('data-key');
31      const value = this.getAttribute('data-value');
32
33      // クッキーに保存
34      setCookie('selectedDestinationKey', key);
35      setCookie('selectedDestinationValue', value);
36
37      // hidden に値をセット
38      hiddenInput.value = key;
39
40      // ホームの表示部分を更新
41      displayArea.value = value;
42
43      // ボタンの選択状態を更新
44      buttons.forEach(btn => btn.classList.remove('active')); // 全ての選択状態をリセット
45      this.classList.add('active'); // 選択されたボタンにクラスを追加
46
47      // モーダルを閉じる
48      const modalInstance = bootstrap.Modal.getInstance(document.getElementById('search_arrival'));
49      if (modalInstance) {
50        modalInstance.hide();
51      }
52    });
53  });
54});

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.