Created
July 28, 2022 18:07
-
-
Save tjtate/90e8a72e9ff58a8f00bc4569c7ca193c to your computer and use it in GitHub Desktop.
signupapp example
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
<html> | |
<head> | |
<title>Site 1</title> | |
<script src="https://code.jquery.com/jquery-3.6.0.min.js" integrity="sha256-/xUj+3OJU5yExlq6GSYGSHk7tPXikynS7ogEvDej/m4="crossorigin="anonymous"></script> | |
<script> | |
// var bsLeadgenConfirmCampaign = 'Lead Gen – LW Dividend ETFs'; | |
</script> | |
<script> | |
jQuery(document).ready(function($) { | |
var sourceid = getParameterByName('sourceid'); | |
if (sourceid !== null) { | |
//change the class name to whatever the xcode value is in the signupapp form code | |
$('.source').val(sourceid); | |
} | |
function getParameterByName(name, url) { | |
if (!url) url = window.location.href; | |
name = name.replace(/[\[\]]/g, '\\$&'); | |
var regex = new RegExp('[?&]' + name + '(=([^&#]*)|&|#|$)'), | |
results = regex.exec(url); | |
if (!results) return null; | |
if (!results[2]) return ''; | |
return decodeURIComponent(results[2].replace(/\+/g, ' ')); | |
} | |
}); | |
</script> | |
</head> | |
<body id="some-id"> | |
<h1>Site 1</h1> | |
<form class="signupapp"> | |
<input class="source" type="hidden" value="ABC"> | |
</form> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment