Files
medicalalert-web-reloaded/wp/wp-content/themes/thbusiness/js/subid.js
Tony Volpe 4eb982d7a8 Merged in feature/from-pantheon (pull request #16)
code from pantheon

* code from pantheon
2024-01-10 17:03:02 +00:00

34 lines
1.0 KiB
JavaScript

jQuery(document).ready(function(){
function setCookie(name, value, days){
var date = new Date();
date.setTime(date.getTime() + (days*24*60*60*1000));
var expires = "; expires=" + date.toGMTString();
document.cookie = name + "=" + value + expires;
}
function getParam(p){
var match = RegExp('[?&]' + p + '=([^&]*)').exec(window.location.search);
return match && decodeURIComponent(match[1].replace(/\+/g, ' '));
}
var subid1 = getParam('subid1');
var subid2 = getParam('subid2');
var subid3 = getParam('subid3');
var subid4 = getParam('subid4');
function readCookie(name) {
var match = document.cookie.match(new RegExp(name + '=([^;]+)'));
if (match) {
return match[1];
}
return undefined;
}
jQuery('input[name="subid1"]').val(readCookie('subid1'));
jQuery('input[name="subid2"]').val(readCookie('subid2'));
jQuery('input[name="subid3"]').val(readCookie('subid3'));
jQuery('input[name="subid4"]').val(readCookie('subid4'));
});