Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

js check for url parameter

const params = new URLSearchParams(window.location.search);

// Check if we have the param
if (params.has("myParam")) {
  console.log("Yep!  We have it.  Value is: " + params.get("myParam"));
} else {
  console.log("The param myParam is not present.");
}
 
PREVIOUS NEXT
Tagged: #js #check #url #parameter
ADD COMMENT
Topic
Name
4+6 =