Last active
December 11, 2023 18:06
-
-
Save elephantsneverforget/3266614908a02123c73e62985b60c6fb to your computer and use it in GitHub Desktop.
This file contains hidden or 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
// Lucky Labs creates a Custom Event with additional data | |
var luckyEvent = new CustomEvent('luckyEvent', | |
{ | |
detail: | |
{ | |
message: 'store_finder_event', | |
email: "[email protected]", | |
location: "", | |
otherInfo: "", | |
product: {} | |
etc... | |
} | |
} | |
); | |
// Lucky Labs dispatches the event in the parent frame | |
document.dispatchEvent(luckyEvent); | |
// Elevar listens for event and processes | |
document.addEventListener('luckyEvent', function (e) { | |
console.log('Lucky Event fired!'); | |
console.log('Event Data:', e.detail); | |
}, false); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment