1
0

クエリパラメーターを取得する時は、URLSearchParamsインタフェースを使用すると簡単に実装ができます。

実装例

const searchParams = new URLSearchParams(window.location.search)

const param1 = searchParams.get('param1')
const param2 = searchParams.get('param2')
const param3 = searchParams.get('param3')

存在しないキーが指定されているとnullが返ります。

参考

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0