This site uses cookies own and third. If you continue to browse consider to accept the use of cookies. OK More Info.

get param url

  • 1 Replies
  • 1739 Views

0 Members and 1 Guest are viewing this topic.

Offline catotinho

  • *
  • Underc0der
  • Posts: 3
  • Actividad:
    0%
  • Country: 00
  • Reputación 1
    • View Profile
    • Email

get param url

  • on: April 22, 2022, 02:20:58 pm
Buenas les dejo una pequeña funcion para trabajar con los parametros url

Code: You are not allowed to view links. Register or Login
  function getParam(param){
    const url = new URL(window.location.href);
    let searchParams = new URLSearchParams(url.search);
    return (searchParams.get(param));
  }
use de ejemplo la url  You are not allowed to view links. Register or Login

Code: You are not allowed to view links. Register or Login
         console.log(getParam('status'); // imprime por consola post.
Mi primer pequeño aporte, gracias.

Offline ANTRAX

  • *
  • Administrator
  • Posts: 5854
  • Actividad:
    80%
  • Country: ar
  • Reputación 43
  • ANTRAX
  • Twitter: @Underc0de
    • View Profile
    • Underc0de
    • Email

Re: get param url

  • on: April 22, 2022, 02:23:04 pm
Muy bueno! Muchas gracias por compartir!

Saludos!
ANTRAX