Skip to main content

All Questions

1 vote
1 answer
887 views

Node js Child process event emitter vs callbacks

Is there any difference between attaching callbacks or event listeners for child process in nodejs. like - const execute = require('child-process').exec; const process = execute('ping -n 1 www.google....
sahil aktar's user avatar
4 votes
1 answer
516 views

Add/remove eventListeners while keeping instance context of "this"

I am trying to use the vanilla JS event system to send events between different components of my browser application (no NodeJS involved), by dispatching events to the window object. // method in ...
Cirrocumulus's user avatar
0 votes
1 answer
366 views

How to manage events in converse.js xmpp library

Im actually developing a custom ERP for my business company and i need implement xmpp web based chat applicatión using Converse.js. But i can't find any solution to manage events callback's with the ...
Moises bolaños davila's user avatar
1 vote
1 answer
150 views

Set onclick method for an element in a loop using local variables without having it activate immediately

I have a for loop in which I'm using a local variable from the loop as a parameter for an onclick event callback. I'm doing it according to what I've read in these posts: Passing parameter onclick, ...
SemperCallide's user avatar
1 vote
1 answer
42 views

How to access the global-level object from a callback inside the same global-level object's attribute?

var calendar = { activeDates: null, dateClicked: function () { this.activeDates = document.querySelectorAll( '[data-calendar-status="active"]' ) for (var i = 0; i < this....
Jiang Ng's user avatar
0 votes
1 answer
36 views

JavaScript : When exactly the function assigned to the onload event executes?

function loadScript(src, callback) { let script = document.createElement('script'); script.src = src; script.onload = () => callback(script); document.head.append(script); } loadScript('/...
AjithKumar's user avatar
1 vote
1 answer
827 views

Pixi.js: How to Detect end of movie (callback for ended event?)

I have a project where I need to switch between full HD videos in a browser. I realized that my macbooks fans are starting to blow after a while. My assumption was that the video load is a bit too ...
Merc's user avatar
  • 4,482
0 votes
1 answer
473 views

Full Calendar callback function on time slots selections

How it is possible to get the times that selected? In my scenario, I have a calendar that is selectable and the user can select some cells of calendar, then if the selected time becomes less than 3 ...
Nasser Ali Karimi's user avatar
0 votes
1 answer
144 views

window scroll event – need prevent bubbling or not?

Which of these examples is more correct? window.addEventListener('scroll', someFunc, false); window.addEventListener('scroll', someFunc); I know what is bubbling, it moves up from element to window....
Michael Rafailyk's user avatar
0 votes
1 answer
313 views

How can I trigger a custom event and use it's callback return value NOW?

Normally I can do something similar (I could use array to manage multiple subscriptions) in vanilla js. window.doCensorship = function($value, $proposal){return true}; function canPublish(text){ ...
beppe9000's user avatar
  • 1,106
2 votes
2 answers
3k views

How can I pass an argument to the callback function of an event listener without losing the "event" property?

I have no idea of how to do this, I want to pass an argument to the callback function "ctrlDeleteItem": document.querySelector('.container').addEventListener('click', ctrlDeleteItem); But if I do ...
BraisC's user avatar
  • 299
0 votes
1 answer
18 views

html add link for call selfFunction with arg obj

it possible inside html to pass a link with self function and pass arg OBJ from the scope example function notifier_ADD(ZZZ) { let message = /*html*/`<a href="#" onclick="...
jon's user avatar
  • 1,688
1 vote
1 answer
37 views

Staying away from global state with sync callback handlers in AcornJS

I am using AcornJS and trying to stay away from global variables. I am looking for a functional paradigm that will allow me to accumulate an array of data from two handlers from the types.visit ...
ThomasReggi's user avatar
  • 58.2k
0 votes
2 answers
32 views

How make an events target accessable in another function?

I have the following code scenario, where right now e.target.parentNode.parentNode.removeChild( e.target.parentNode );is not accessable in deleteUser. Is there a way to connect it or any other ...
codeDragon's user avatar
0 votes
2 answers
69 views

Maintaining state across asynchronous events in javascript

We have a loader which is based on an event listener. This is through pouchdb. So each time a document is received to the client the listener fires. We check if that document is related to the loader ...
MilindaD's user avatar
  • 7,643

15 30 50 per page
1
2 3 4 5