Показать сообщение отдельно
  #2 (permalink)  
Старый 16.04.2019, 16:11
Аватар для SuperZen
Профессор
Отправить личное сообщение для SuperZen Посмотреть профиль Найти все сообщения от SuperZen
 
Регистрация: 08.11.2017
Сообщений: 642

<script>
  // localhost/html.html?club=one&more=two#showMe
  // https://developer.mozilla.org/en-US/docs/Web/API/Location
  // https://developer.mozilla.org/en-US/docs/Web/API/HTMLHyperlinkElementUtils/hash
  console.log(window.location.hash)
  // https://developer.mozilla.org/en-US/docs/Web/API/HTMLHyperlinkElementUtils/search
  console.log(window.location.search)
  const query = new URLSearchParams(window.location.search.slice(1))
  console.log([...query.entries()].map(([key, value]) => ({ key, value })))
</script>
Ответить с цитированием