JavaScript events register various event handlers/listeners on the element nodes inside an HTML document DOM tree.

learn more… | top users | synonyms (1)

0
votes
0answers
6 views

Using right-click to draw brush with d3.js

I am adapting the force directed d3.js chart here: http://bl.ocks.org/pkerpedjiev/0389e39fad95e1cf29ce. I would like to have right-click and drag have the same behavior as shift+left-click and drag, ...
0
votes
1answer
16 views

How to capture Mouse and Keyboard data across all websites for Chrome

Just as the title implies. How would I go about capturing general event data across websites? This is supposed to be a strictly client-side application. Would a chrome extension work? If so, how would ...
0
votes
1answer
17 views

Why are these event callbacks being called before the events take place?

I am working with event listeners outside the scope of Angular and jQuery, and I am exploring recursion at the same time. In this example, I want to add a simple listener to all members of a class ...
0
votes
0answers
3 views

Jvector Map - generate event OnRegionClick on a Drill-down map

I've succesfully managed to create a drill-down Map showing Italian provinces. Now I need to create an event on clicking each province but I am not able to find where to insert my OnRegionClick event. ...
0
votes
0answers
2 views

How to test document.addEventListener('keydown', cb) with Mocha & Sinon?

I'm trying to figure out the best way for testing this method: document.addEventListener("keydown", function (event) { var modifiers = event.altKey || event.ctrlKey || event.metaKey || ...
0
votes
1answer
26 views

How to check the class name of the event target in ReactJS?

I now have a function handleRightClick(e) which will be called when I right click on the container. Inside the container, there are several Items and I expect the menu will be shown only when I right ...
1
vote
1answer
21 views

make suggestion box delay, to match the timing of transition of search

step 1:user click search : it should translate(working). step 2: after translation suggestion box should show up (not working). step 3: when you click elsewhere in screen the search bar should ...
0
votes
0answers
7 views

What events should I handle in express response (stream) object to handle when the response finishes?

I'm trying to automatically log when a request finishes. I have something like this: function (req, res, next) { var startTime = clock.now(); res.on('end'. function() { logger.trace("...
0
votes
0answers
14 views

Stop or reverse a Parallax Scroll

I have a portfolio I am building I have 3 elements scrolling 2 up and one down, I am trying to get the image of me 'fore-kang' to when it reaches the top of the section to either stop scrolling so the ...
0
votes
0answers
7 views

using the type property to identify paste or drag event

According to https://developer.mozilla.org/en-US/docs/Web/Events/paste: The paste event has a type property: type Read only DOMString The type of event. The problem is that I need to ...
2
votes
3answers
46 views

Why does this not want to find the selector on dynamic content?

I have the below select to choose a second form to pull in via load() into the #formContent div which works fine. <form id="selectform"> <select id="selector" class="form-control" name="...
0
votes
0answers
23 views

In React, what's the difference between onChange and onInput?

I've tried searching around for an answer to this, but most of them are outside the context of React, where onChange triggers upon blur. In performing various tests, I can't seem to tell how these ...
-1
votes
0answers
15 views

How to implement Google Analytics click event tracker in Unbounce?

When a button click happen, send a hit to ga. But how without using "onClick.." code HTML? I can just add JS.
0
votes
0answers
36 views

Trying to set mouseover on the node but the label of the node triggers multiple events

I am trying to set up a simple mouseover and mouseout event on a D3 node. All works fine the only issue is when I have a label on the node. When I mouseover the node I get the event, but then when I ...
0
votes
0answers
15 views

Fire a typed scroll when it is a certain time of the day

certain event to fire off at a certain time of day, as you can see below, more than likely a mess, I am trying to have it at a certain time fire off the good morning typed.js and then when it is ...
-5
votes
3answers
34 views

why javaScript behave like synchronous without web api call

I know javaScript is synchronous by nature. So that when I call a function with web API It performs synchronous. setTimeout(function(){ console.log('1'); }, 2000); console.log('2'); it will ...
0
votes
0answers
17 views

print dialogue is coming twice on using preventDefault function in onClick event handler

I am using below code to handle the click event on the print button <!DOCTYPE html> <body> <div> <button class="button" id="printButton" onclick="window.print(); event....
0
votes
0answers
22 views

SquareSpace mobile navigation anchor links won't work

On this site, the main navigation uses #anchor links to scroll around to the various sections of the single page site. The problem is at mobile resolutions, when the navigation is collapsed into a ...
0
votes
1answer
25 views

Blur function not working on all posts

The HTML code is {{> addPost}} {{#each post}} {{> postItem}} {{/each}} </template> <template name="postItem" > <div class='container'> <div ...
2
votes
1answer
43 views

Remove eventListener in Javascript

I have the following situation: A section with id #section, on double click I am adding a form which contains labels, inputs a save button and a close form button. For close form button on click I ...
1
vote
2answers
44 views

How can I create a toggle button using keyboard controls?

I have a simple information button. When this button is clicked, it opens an information text box, when you click that button again, that information box goes away, or 'toggles off'. I'm trying to ...
3
votes
2answers
40 views

window.removeEventListener with a named function isn't working

I am using React and below is the code I am using to implement the infinite scroll feature. componentDidMount() { // Flag to check if the content has loaded. let flag = true; function ...
0
votes
0answers
23 views

Javascript questions about DOMContentLoaded

I want to learn JavaScript so I started to create a minimal Jquery clone. I found this example to find out if the DOM is loaded or not var domReadyStack = []; function handleDOMReady(fn) { ...
0
votes
0answers
13 views

How to handle OnReadyStateChanged event in iframe (in IE11)?

I have a chunk of code with a function attached to the onreadystatechanged event of an iFrame. In IE8 there was an attribute available called readyState. This event still fires in IE11, but my ...
1
vote
1answer
17 views

setting left position in the body of mousemove event listener function doesn't work

I want one of my div's position left value equal to my mousemove event.clientX. Although individual items in my code works by themselves, following code doesnt work. Why ? var shapeCanvas = document....
0
votes
0answers
20 views

How to identify if onfocus event is coming from embedded iframe

In the below code the onfocus event gets called if [1] Click play button in youtube [2] click outside the iframe area. I think the focus change from current window to iframe window and this ...
0
votes
0answers
11 views

How to focus automatically on the current date in vis.js timeline

I wrote a program that uses vis.js timeline and focuses on the current date on the click of a button: <button type="button" class="btn btn-info" onclick="timeline.focus(0)">Focus on current ...
0
votes
0answers
23 views

Adding event listeners and passing in the object [duplicate]

This is my current code: Index.html AddEventListener('click', 'a[data-requestpartial]', function (obj, e) { e.preventDefault(); // Error is happening here. this is undefined....
0
votes
2answers
37 views

ReactJS - Handle parent event in child event handler

I have a react container where I want to capture mousemove events. That is pretty straight forward. Further I have a react sub-component rendered by the container where actually the logic for the ...
0
votes
1answer
22 views

Event handler not triggered on specified event

I am implementing an user-input form with complex data-field dependencies. For example, a form that collects user's address: country, state, and street-address. When the country field is changed, I ...
0
votes
0answers
22 views

Custom lightbox - multiple gallery

Hi I have a problem with my JavaScript lightbox. It's a custom lightbox. It's work perfect if I have one type of the gallery. I have html structure gallery type: Section with class .section-...
-4
votes
0answers
27 views

Element not getting clicked , help , anyone? [closed]

I want to click this element but its not getting clicked Help $('#add-cart-button-id').click(); plz tell me what im doing wrong
2
votes
0answers
114 views
+50

Excel VBA controls Webpage and fills out details. Clicks on save, appears to work, but nothing is saved

Summary: Basically trying to edit a website with Excel VBA. The edits appear to work, but when I use the save button, nothing is saved. I know the save button works, explained below. So why isn't my ...
-1
votes
2answers
24 views

Increment and re-execute Javascript

In my javascript code var x=1.When some event occured, 'var x' will be incremented by 1. The updated 'x' value will be used for some other events. But the variable x value is always 1. It is because ...
0
votes
2answers
15 views

jQuery on change event not triggered by jQuery itself?

I placed a listener on all checkboxes on my page with .on('change'). When clicking on a checkbox it actually detects the change and fires a function. BUT, when I use a jQuery function to set a ...
0
votes
1answer
22 views

Removing a JavaScript event: Why is this example not working?

I am struggling with removing a JavaScript event that has previously been added to a DOM element wit element.addEventListener: $(() => { var example = { init() { this.element = ...
1
vote
1answer
34 views

Injecting elements and attaching Click event handlers in a loop with javascript

I'm trying to make a dropdown which is populated from an array with javascript. Each Item needs to have an event trigger attached, but it currently only attaches the event to the last element. I have ...
-1
votes
3answers
51 views

console.log gives undefined on a variable

I have a timer function(it calculates how many words were read in given time but my code doesn't work(it says "Uncaught ReferenceError: startTime is not defined" on line "testTime = (stopTime - ...
0
votes
1answer
41 views

How to detect any key press in Angular 2?

How do I detect any key press on Angular 2 (e.g. not necessarily in an input box) Currently I managed to do this using the following code: import {Component, HostListener} from "@angular/core"; @...
0
votes
0answers
17 views

jQuery click event target is the inner est HTML element

I handle the click event of a nested element element1-> element2-> element3 $(document).on("click", function(e){}) $(document).on("click", "#element3", function(e){}) However on IE10 the event ...
1
vote
1answer
30 views

this.on event Emitter on react-native is not a function

I'm trying to emit and listen on a Event. The emit is working but when I try to listen the application breaks. Can anybody give me a hand on this? This is the code export class EmitEvents extends ...
1
vote
0answers
29 views
+50

How to prevent scroll but not link following when firing touchstart event over <a> tag in pure JS?

I don't know if this is even possible but I'm trying to detect touchstart over an <a> tag. When touched, the scroll should be prevented but if the finger is released without moving, the link ...
0
votes
1answer
21 views

What does Touch Punch JQuery UI offer?

I'm using JQuery UI Touch Punch, like I use it in this JSFiddle. I searched a lot of places to figure out what event and ui contains, but I wasn't able to find something about it. Is there some kind ...
-1
votes
1answer
16 views

How do you use an event listener in markers whose event toggles between two functions when listened to?

I have this section of code which works well: marker.addListener('click', function(){ showInfo(marker, content); }); marker.addListener('dblclick', function(){ hideInfo(); }); I’m using two ...
1
vote
2answers
43 views

Add event listener that tracks event and clicked object?

I have an event listener that captures the event, but I want to also capture which item was clicked. This is my code: $(document).ready(function () { function shareEventHandler(evt) { if (...
0
votes
2answers
21 views

how does Javascript(NodeJS) handle scope and context with regard to events [duplicate]

i'm a bit confused in a situaiton, given the sample code here where i'm loading several urls, and connected the event Listener var pages= Array(); var loading= Array(); for(i=0; i < urls.length; ...
1
vote
2answers
34 views

Polymer 1.5/iOS: How to stop event propagation over iron-pages

We have a one page app which uses iron pages and express-router to navigate. In the browser and on android it works perfectly, on iOS however, we have a bug. The problem occurs if we switch pages by a ...
0
votes
2answers
52 views

It is possible to use regex in Javascript onclick event (HTML)?

My question is quite simple but I cannot find the truth It is possible to use regex in Javascript onclick event (HTML)? for example is it possible to show div with different id but a same tag using ...
0
votes
1answer
40 views

How to use a function in an external Javascript file in HTML?

This is my first time using an external javascript file. I am doing the exercise in the murach series of books on Javascript and I am stuck on some pretty basic things. I will show the javascript ...
0
votes
0answers
26 views

Is a function stored in memory once it is called ?

I know there are many solutions with this type of question but somehow they are very complex. I wanted to know what happens once a function is called. For example, in my sample code, when I call ...