Pass arbitrary data from the page, through the Activator Widget

This code was used for ASIS, and is more of a starting point for other events, rather than a plug and play solution. Be sure to consult dev. before using this code for your event.

<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.2/jquery.min.js"></script>

<script src="https://cdn.ingo.me/widgets-loader/1.0.1/js/ingo.loader.widget.js" data-ingo-id="WIDGET_ID_HERE">

</script>

<script>
function replaceUrlParam(url, paramName, paramValue){
if(paramValue == null)
paramValue = '';
var pattern = new RegExp('\\b('+paramName+'=).*?(&|$)')
if(url.search(pattern)>=0){
return url.replace(pattern,'$1' + paramValue + '$2');
}
return url + (url.indexOf('?')>0 ? '&' : '?') + paramName + '=' + paramValue
}

$("#txtPriorityCode").on("change paste keyup", function() {
var url=window.location.href;
var newUrl = replaceUrlParam(url, "pc", $(this).val());
window.history.replaceState(null, null, newUrl);
});
</script>