-
-
Save nocodesupplyco/d961af86b30f851d272805cb722625cd to your computer and use it in GitHub Desktop.
Set Text From URL Parameters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(function () { | |
// Get URL parameters and set variables, text and CTA | |
const queryString = window.location.search; | |
const urlParams = new URLSearchParams(queryString); | |
if (urlParams.has("name") && urlParams.get("name") > "") { | |
//if URL has name parameter and it has a value | |
var firstname = urlParams.get("name"); | |
$("#heroName").text(firstname); | |
} else { | |
$("#heroSee").hide(); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment