¿Cómo verificar si isset HTTP Get method en JavaScript o JQuery?
Estamos en la página con la siguiente URL:
https://example.com/blog?page=2 y quiero comprobar si isset Get method o no:
<script> if (isset(method.get)){ // yes is set } </script>¿Qué tengo que hacer?
prueba esto:
const Get = new Proxy (new URLSearchParams (window.location.search), { get: (searchParams, prop) => searchParams.get (prop), }); if (Get.page){ // page is the ?page=3 // yes is set }