Create the generateID() helper
This commit is contained in:
parent
eab770a478
commit
dc7b48e2d0
12
index.html
12
index.html
@ -169,6 +169,8 @@
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
const characterIDChars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
|
||||
|
||||
const checkLocalStorage = () => {
|
||||
let storage;
|
||||
try {
|
||||
@ -189,6 +191,16 @@
|
||||
}
|
||||
};
|
||||
|
||||
const generateID = () => {
|
||||
var result = "";
|
||||
|
||||
for (var i = 0; i < 16; i++) {
|
||||
result += characterIDChars.charAt(Math.floor(Math.random() * characterIDChars.length));
|
||||
}
|
||||
|
||||
return result;
|
||||
};
|
||||
|
||||
document.addEventListener(
|
||||
"DOMContentLoaded",
|
||||
() => {
|
||||
|
Loading…
x
Reference in New Issue
Block a user