Created
October 14, 2022 15:50
-
-
Save neopunisher/768cd2e88aa2aaf006d62a432f3b6b9c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
document.addEventListener('yourCustomEvent', function (e) { | |
var data = e.detail; | |
console.log('received', data); | |
}); | |
var data = { | |
allowedTypes: 'those supported by structured cloning, see the list below', | |
inShort: 'no DOM elements or classes/functions', | |
}; | |
document.dispatchEvent(new CustomEvent('yourCustomEvent', { detail: data })); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment