freifunk-rhein-sieg.net/assets/js/kontakt.js

22 lines
728 B
JavaScript
Raw Normal View History

2018-03-20 20:18:03 +00:00
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, " "));
}
2018-03-18 18:37:59 +00:00
$(function () {
2018-03-20 20:18:03 +00:00
const param_rcp = getParameterByName('rcp')
if(param_rcp !== "") {
const rcp_option = $('#recipient>option[value=' + param_rcp + ']');
if(rcp_option.length === 1) {
rcp_option.attr('selected', true);
$('#recipient_option_choose').removeAttr('selected');
$('select').material_select();
}
} else {
$('select').material_select();
}
2018-03-18 18:37:59 +00:00
})