構文
 
  location.search
総合 インデックス
プロパティ
FirefoxIE

説明

  • 表示されているページのURIに関する情報のうち,問い合わせ文字列(?で始まる問い合わせ文字列)部分の値を持つ。
  • 読み出し専用。

用例

ブラウザに表示しているページのURIのうち,問い合わせ文字列部分の値を取得し書き出す。
<script type="text/javascript">
<!--
document.write("URI:",location.href);
document.write("<br>");
document.write("問い合わせ文字列:",location.search);
//-->
</script>

この用例を実行する