メニューを切り替える
個人設定メニューを切り替える
個人メニューを切り替える
ログインしていません
編集を行うと、IPアドレスが公開されます。

「飲食店検索」の版間の差分

提供: 川西図鑑
編集の要約なし
編集の要約なし
4行目: 4行目:
<html>
<html>
<form method="get" action="">
<form method="get" action="">
   <input type="text" name="検索" placeholder="店名・住所・ジャンルで検索" style="width:300px;" />
   <input type="text" name="検索" placeholder="店名・住所・ジャンルなど" style="width:300px;" />
   <input type="submit" value="検索" />
   <input type="submit" value="検索" />
</form>
</form>
<script>
document.addEventListener('DOMContentLoaded', () => {
  const urlParams = new URLSearchParams(window.location.search);
  const searchVal = urlParams.get('検索');
  const input = document.querySelector('input[name="検索"]');
  if (searchVal) {
    const decoded = decodeURIComponent(searchVal);
    input.value = decoded;
    // 無限ループ防止: URLとデコード済みが一致しなければ書き換え
    if (searchVal !== decoded) {
      const newUrl = window.location.pathname + '?検索=' + encodeURIComponent(decoded);
      window.history.replaceState({}, '', newUrl); // ページ遷移はさせない
    }
  }
});
</script>
</html>
</html>
== 検索結果 ==
== 検索結果 ==

2025年10月27日 (月) 15:35時点における版

検索条件

検索結果

エラー: テーブル店舗情報が見つかりません。