Skip to content

Instantly share code, notes, and snippets.

View rocket111185's full-sized avatar

Dmytro Rekechynsky rocket111185

View GitHub Profile
@rocket111185
rocket111185 / jquery-trigger-once.js
Last active February 27, 2024 16:28
Function triggerOnceWhenElementExists. It creates jQuery listeners which will trigger the code on a specific event eventName once only if the element exists
function generateRandomIdentifier(length) {
const firstLetterCode = 97;
const numberOfLetters = 25;
const randomCharacter = function () {
const letterPosition = Math.round(numberOfLetters * Math.random());
return String.fromCharCode(firstLetterCode + letterPosition);
};
let identifier = '';