Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Adds ability to collect donation amounts in string query passed in URL. Great for adding auto amounts in buttons and text inside emails.
// Added by for pinning amount to string query
// Used for creating buttons in emails with links for specific dollar amounts
function getQueryVariable(variable)
var query =;
var vars = query.split("&");
for (var i=0;i<vars.length;i++) {
var pair = vars[i].split("=");
if(pair[0] == variable){return pair[1];}
var amt = getQueryVariable("donation_amt");
if (!amt) return;
$('#donation_amount_'+amt).attr('checked', true);
// Uncomment to Automatically progress to second stage
// $('.progress-stage-button-next').click();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment