custom-events Questions

3

Solved

Is it possible in JavaScript to listen for a change of attribute value? For example: var element=document.querySelector('…'); element.addEventListener( ? ,doit,false); element.setAttribute('somet...
Valleau asked 2/1, 2017 at 10:25

4

Solved

This is pretty annoying. I want to just trigger an event in javascript. I need to pass the event object into the parameters as usual and an additional custom parameter. In jQuery, this would be su...
Sherrillsherrington asked 4/9, 2013 at 12:10

4

Solved

Is it possible to dispatch a svelte event (created with createEventDispatcher) with a target object like a native browser event? I.e. receiving on the handler side event.target.value instead of eve...
Dolomites asked 7/4, 2021 at 9:4

1

Solved

To let Web Components communicate with each other, I'm using custom events. Let's imagine the following: WebComponentA uses or contains WebComponentB which sends a CustomEvent (bubbles: true, compo...

5

Solved

How can I know in my triggering code that preventDefault has been called? $(document).trigger('customEvent', params); if (/* ??? */) doDefaultActions();
Rarefied asked 9/2, 2010 at 14:14

0

I am sending custom events in my firebase analytics and one of the event's values shows (not set). I have crossed check everything with logs and all, and the value and parameter name, nothing is g...
Psych asked 14/10, 2019 at 5:46

2

Solved

I've used jQuery version 2.2.4 and tried to capture event - no luck. Is there any way to fix issue? This code works: window.addEventListener('test.namespace', e => console.log('CustomEvent wit...
Firsthand asked 3/6, 2016 at 15:15

7

Solved

I am creating an event, so use the DOM Event constructor: new Event('change'); This works fine in modern browsers, however in Internet Explorer 9, 10 & 11, it fails with: Object doesn't su...

2

Solved

I have multiple pages being tracked by google analytics. On all these pages I have an outbound link for which I make a call to create a custom event - the action is named the same on all the pages....
Culvert asked 23/3, 2011 at 0:42

1

Solved

I am creating a bunch of web components and each of them can emit custom events. As an example here are two simple examples: //MyButton emits 'myButtonPressed' and detail of this type: interface B...
Lotson asked 10/1, 2019 at 16:42

2

Solved

I'd like to dispatch an event that will pass some data to any event listeners that listen on that event. Considering a function that fires an event: function click() { const x = 'foo' document....
Rate asked 18/5, 2014 at 19:10

0

I want to dispatch a CustomEvent on different occasions. Most examples on the net create and dispatch CustomEvents only once. I want to know how to do it correctly. In this example the "A-Button" ...
Enquire asked 14/6, 2017 at 5:48

2

Solved

I have a ComboBox in my page and I want to bind keypress event to my Kendo ComboBox when the cliend writes down any letter. As I understand kendo doesn't have any keypress event on ComboBox. I've...
Filly asked 27/1, 2013 at 10:49

1

Solved

In order to send a message to another document (let's say an iframe), you can use both postMessage and createEvent functions. Assume this: var event = document.createEvent('CustomEvent'); event.in...
Materiality asked 12/5, 2015 at 6:41

3

Solved

I am working on an AngularJs project. I have a service which sets and removes events on some buttons. This service is utilized by another service which I do not want to interact directly with the b...
Effie asked 9/6, 2014 at 21:55

1

I know it is possible to add an event listener to a custom event that I have created in Javascript, like this: window.addEventListener("MyCustomEvent", myFunction, false); But...Is it possible t...
Tumulus asked 31/7, 2014 at 15:49

2

Solved

I'm attaching a custom event handler to the body in jQuery's ready method. Afterwards I immediately trigger the custom event but nothing seems to happen. $(function(){ $("body").on("test", functi...
Onagraceous asked 19/6, 2013 at 23:42

1

Solved

Any ideas how to extend the step-function in jQuery 1.6+? I've made a special-event to trigger a custom-event on each animated step. However since jQuery's animation method was changed, or rather ...
Coal asked 23/1, 2013 at 14:5

1

I have a page A that opens a popup to B. Page B, after some jobs, always redirects to another page C in the pop up. Page C then dispatches an event to send some data to page A, but page A has no re...
Erde asked 19/12, 2012 at 14:27

2

Solved

Can anyone tell me why this code would not be working? $('body').on('test', function() { alert('test'); }); $('body').trigger('test'); I'm using jquery-1.7.2.min. I do not get any errors, just...
Paraphrastic asked 4/6, 2012 at 16:51
1

© 2022 - 2024 — McMap. All rights reserved.