How to check if isset HTTP Get method in JavaScript or JQuery?
We are in page with bellow url:
https://example.com/blog?page=2
and i want to check if isset Get method or not:
<script>
if (isset(method.get)){
// yes is set
}
</script>
What should i do?
try this:
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
}