Most voted "event-listener" questions
25 questions
Sort by count of
-
10
votes1
answer1326
viewsLaravel 5.3 - Events or Observers?
I have some scenarios where I can use Observers to fire a notification, however, for me it would be indifferent to use Observer or create an Event, a Listener and then use this to fire a…
php laravel pattern-design event-listener observer-patternasked 8 years, 8 months ago Fábio Jânio 3,407 -
9
votes4
answers701
viewsHow to create and use custom events
Researching I found Event and CustumEvent, both can be used to create events, and to control registrations, removals and emissions of the event should be used EventTarget, but I didn’t understand…
-
5
votes1
answer51
viewsHow to wait for a user action on a Job?
The Situation Having a service queue, where whenever a user enters the queue he receives a position number in the queue, I need to request the presence of the first of the queue. If the first row…
-
3
votes2
answers51
viewsWhy doesn’t Event exist inside the lower block?
I’m having trouble accessing the event.target within the function setTimeout in the code below. const botao = document.querySelector('button'); botao.addEventListener('click', () => {…
-
2
votes1
answer43
viewsProblem with Eventlistener execution
if((document.getElementById("avatarZica").innerHTML == "")){ document.getElementById("avatarLegal").addEventListener("click", function(){ document.getElementById("avatarZica").innerHTML =…
-
2
votes1
answer74
viewsHow do I do an event on the moon?
i want to know how to make an event, for example with the do to see if the user typed 'q' or 'o', as if it were in a addEventListener()
-
2
votes1
answer94
viewsFunction Listener being fired without Event having occurred, Javascript
In my code, I am having add an eventListener for each HTML element of the class "animation". For this I use "addeventlistener", passing the changeBar function as Listener, to be triggered in case of…
-
1
votes1
answer71
viewsAlternatives to beforeunload Event Switch in FF
I’m working on a website and Javascript has an important role in front-end, I was using the event beforeunload to always make a check if the user edited something on the page, to warn you about…
-
1
votes2
answers73
viewsHow to remove events that are created using Arrow Functions?
Does anyone know if there is a way in Javascript to remove events that are created using Arrow Functions instead of creating a function for it? Example:…
-
1
votes1
answer35
viewsCorrect use of the onChildRemoved method in Childeventlistener
Good evening! I’m making a chat app and I list the conversations in a recyclerview. I chose to use the addChildEventListener method, because (I think) it will consume less resources since the data…
-
1
votes0
answers22
viewsEvent onkeyup (Javascript/Jquery) triggered repeatedly makes browser lock
On my page I have a list with some buttons representing data that are presented in another section of the page when the "Submit" button is clicked, triggering the submit function. I added this…
-
0
votes1
answer30
viewsHow to implement a "Liener" in a video?
Well, I have a button and when clicking it, it will call a function that opens a page with a fullscreen video with autoplay="true". IT HAPPENS THAT, after the end of the video I need to redirect the…
-
0
votes0
answers105
viewsEquivalent to PHP eventListener
I have a series of PHP classes that assemble my HTML structures based on CSS Bootstrap already added with their respective Javascript actions, such as this call: $VIDB_button = new…
-
0
votes2
answers55
viewsJavascrit keypress event does not work on mobile
The Javascript code below, which serves to "bar" character > (asc 60) only works on desktop devices and not on mobile devices. <textarea name='notes' id='ta' wrap='physical' cols='65' rows='8'…
-
0
votes0
answers27
viewsHow to prevent an Event Switch globally?
created an Event Listener in App.js with the following: useEffect(() => { window.addEventListener("scroll", e => { scrollToSection_DataLayer('#section1');…
-
0
votes0
answers39
viewsHow to implement a "Listener" in javascript for screen viewing?
I need to implement a change in my code so that when I change DIV, IE, stop viewing the page, the sound that is running automatically stops, as already happens with the videos of Facebook/Instagram…
-
0
votes1
answer855
viewsHow to disable the right mouse button event in Angular 7?
I am trying to disable that menu that appears on the page when the user clicks with the right mouse button. At Angular, I can catch the click event using (click)="onRightClick($event), but I only…
-
0
votes1
answer48
viewsHow does a script work on a web page?
I created a page with three divs that direct to videos according to their title, when clicking on each of them, a modal is opened with the respective video of div. This is the HTML: <body>…
-
0
votes1
answer66
viewsHow to cancel tag a action?
I need to cancel the anchor action after I send an alert. How do I do this? I tried with e.eventDefault(). I tried with the window.location to redirect the page to the default and I’m not getting…
-
0
votes1
answer39
viewsHow to use a multi-page script without giving the eventListener error in the console?
Here is a simple example to demonstrate the doubt. There are two pages and a script. I know it works by importing the script on both pages, but when I use the eventListener, it shows the error…
javascript html javascript-events events event-listenerasked 3 years, 11 months ago Glebson Santos 13 -
-2
votes2
answers873
viewsJavascript does not load all functions
Have (a|a) (great|great) (day|late|night)! All right! When inserting many functions in a <script type="text/javascript"></script> My code is not running all of them! The browser console…
javascript javascript-events click events event-listenerasked 7 years ago Leonardo Lima De Sousa 29 -
-2
votes1
answer35
viewsImage is not changing when I click (javascript)
I’m doing an old game and added an eventListenner to each space, so that as soon as I clicked, the image would change. But it’s not working and I can’t understand why. Follow js, HTML, CSS and…
javascript html5 front-end javascript-events event-listenerasked 5 years, 8 months ago Robert Vitoriano 119 -
-2
votes1
answer338
viewsHow to capture all elements with the same class at once?
I’m taking Javascript course and I’m having a lot of difficulty. I can’t wait to run to jQuery, who I haven’t even studied yet, but I can handle a thousand times better. My problem is getting all .…
-
-2
votes1
answer28
viewsError after calling Event
After calling the Event click on the button, the calculation appears with no result and the HTML that entered through the JS disappears from the screen right after the call. PS: Ignore developing…
-
-3
votes1
answer27
viewsUse information from an Event in if Else
People, I’m doing an exercise to create a set of stone, paper and scissors. Within the development I arrived at a problem, my if statement is not working. To with 1 month of programming only, then…