Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

javascript custom events with data

//Listen for the event
window.addEventListener("MyEventType", function(evt) {
    alert(evt.detail);
}, false);

//Dispatch an event
var evt = new CustomEvent("MyEventType", {detail: "Any Object Here"});
window.dispatchEvent(evt);
Comment

PREVIOUS NEXT
Code Example
Javascript :: js reduce concat numbers 
Javascript :: how to find text in jquery with find function 
Javascript :: ggg 
Javascript :: jquery scroll to element 
Javascript :: remove last two elements array javascript 
Javascript :: javascript get width of a div 
Javascript :: javascript get all select options 
Javascript :: stop settimeout 
Javascript :: remove menu bar electron 
Javascript :: regex cnpj javascript 
Javascript :: regular expression for indian mobile number 
Javascript :: how to just have createdAt mongoose 
Javascript :: Get Substring between two characters using javascript 
Javascript :: loop over javascript using foreach 
Javascript :: js num to string with leading 0 
Javascript :: check a checkbox jquery 
Javascript :: Codewars Beginner - Reduce but Grow 
Javascript :: google charts hide legend 
Javascript :: new request javascript 
Javascript :: get current scroll height javascript 
Javascript :: npm react router dom 
Javascript :: loop json object android java 
Javascript :: Uncaught Error: "arc" is not a registered element. 
Javascript :: nodejs readfile 
Javascript :: js rectangle collision 
Javascript :: stop next script when ajaxcall 
Javascript :: native base expo web eror 
Javascript :: make button disabled 
Javascript :: eslint disable react 
Javascript :: jquery select2 hide search box 
ADD CONTENT
Topic
Content
Source link
Name
8+9 =