1
0
mirror of https://github.com/thooge/esp32-nmea2000-obp60.git synced 2025-12-15 06:53:07 +01:00

add repo defaults, add more chips

This commit is contained in:
wellenvogel
2023-09-22 21:14:01 +02:00
parent f800893ac8
commit bb9e7b4de2
2 changed files with 11 additions and 6 deletions

View File

@@ -1,7 +1,8 @@
const getParam = (key) => {
const getParam = (key,opt_default) => {
if (opt_default === undefined) opt_default="";
let value = RegExp("" + key + "[^&]+").exec(window.location.search);
// Return the unescaped value minus everything starting from the equals sign or an empty string
return decodeURIComponent(!!value ? value.toString().replace(/^[^=]+./, "") : "");
return decodeURIComponent(!!value ? value.toString().replace(/^[^=]+./, "") : opt_default);
};
/**
* add an HTML element