Questions tagged [dispatchevent]

170 questions
3
votes
2 answers

How to trigger JavaScript custom events correctly

I am struggling to understand how a custom event type is linked to a specific user action/trigger. All documentation seems to dispatch the event without any user interaction. In the following example I want the event to be dispatched once a user…
TarranJones
  • 4,084
  • 2
  • 38
  • 55
3
votes
2 answers

Javascript dispatchEvent click is not working in IE9 and IE10

I'm trying to simulate mouse events like click, mouseover etc on app build in ExtJs. I'm using below code to simulate click, function triggerEvent(element, eventName) { if (document.createEvent) { var evt =…
Muthu
  • 449
  • 2
  • 7
  • 13
3
votes
4 answers

how to disable dispatch touch event in some portion of screen

I want to disable dispatch touch for some area for your understanding here is my screen. You can see Header,Footer and Mapview in image but when I clicked on location button(right side in header), My map is also getting notified (like it got…
Kalpesh Lakhani
  • 1,003
  • 14
  • 28
2
votes
1 answer

Can an Orbeon event in an XBL be dispatched from Javascript?

Orbeon version: Orbeon Forms 3.8.0.201005270113 I have the following code in a Javascript file. This code is executed, but it seems like the model in the XBL is not found. ORBEON.xforms.Document.dispatchEvent("model-name", "event-name"); Here is…
mstrom
  • 1,655
  • 3
  • 26
  • 41
2
votes
1 answer

How to dispatch Mouse event with fixed X and Y Typescript

I am trying to dispatch a mouse Event with fixed X and Y variables to test some things. It is the only way to do it. I want to dispatch a mouse Event where I can set the X and Y in programm code upon calling the window.dispatchEvent…
2
votes
1 answer

When I try to dispatch I have the error "map.dispatchEvent is not a function"

I create several points on the map (google maps api JS) and it works perfectly, my problem is when I try to place a point with the same coordinates as an existing point. I can get the coordinates of that point, but I need a new point to be created.…
2
votes
1 answer

TamperMonkey: Cannot read property 'dispatchEvent' of null

New to javascript here, I am messing around with using a gamepad while browsing (using gamepad API and TamperMonkey) and I am having trouble simulating to click a certain (x,y) coordinate on the screen. It reports "Cannot read property…
2
votes
1 answer

How to use element.dispatchEvent in chrome console

I created a snippet in chrome devtools but it throws this error when I run it: Uncaught TypeError: element.dispatchEvent is not a function at changeValue (:12:11) at :15:1 This is my code: var script = document.createElement("script"); …
Valip
  • 4,440
  • 19
  • 79
  • 150
2
votes
1 answer

React.js broke dispatchEvent

for example: I add event handler in react:
Then I dispatch event: let clickEvt = new MouseEvent('click', { 'bubbles': false, 'cancelable': true }); elm.dispatchEvent(clickEvt); But nothing happens. I hear you…
BigName
  • 1,018
  • 2
  • 14
  • 29
2
votes
0 answers

JavaScript - dispatchEvent isn´t a function

My code: // node = "" var event = new MouseEvent("click"); node.dispatchEvent(event); Console: node.dispatchEvent is not a function The error only appears in Firefox (Chrome and IE works fine)…
epus
  • 139
  • 1
  • 13
2
votes
1 answer

Call to possibly undefined method dispatchEvent through a reference with static type GetColor

I'm writing a program using Main.as, that needs to listen to a function (getColor) in another class file (GetColor.as). I have the following in GetColor.as: public class GetColor { public function getColor(event:MouseEvent):void { //doing…
UMich_2017
  • 131
  • 9
2
votes
1 answer

How to listen and react on triggered CustomEvent?

I'd like to understand how the CustomEvent system works, in Javascript. [EDIT2] The dream solution is here : http://www.html5rocks.com/en/tutorials/es7/observe/ [/EDIT2] [EDIT] This piece of codes illustrates pretty well the type of DOM-aware…
2
votes
1 answer

Sending keyboard and mouse events from one browser tab to another

So, I have web page that opens another page (browser tab) as a child to the first. The parent tab holds the code that performs the bulk of the application's work. The child tab holds a component that is normally embedded in the parent tab, but…
superqd
  • 333
  • 4
  • 12
2
votes
2 answers

How to fix “element.dispatchEvent is not a function” without breaking something else?

I have same problem as "element.dispatchEvent is not a function" js error caught in firebug of FF3.0 but in google chrome. I have wrote after all scripts. But now I have another problem: ... …
gstackoverflow
  • 36,709
  • 117
  • 359
  • 710
2
votes
3 answers

How can I add a 'change' event listener for a styled select?

Obviously, if I have a 'select' element, I can add an event listener for changes using some basic JS: document.querySelector('select').addEventListener('change', function(ev){ console.log('Changed', ev.target.value) }) Click the 'select' element,…
mikemaccana
  • 110,530
  • 99
  • 389
  • 494
1 2
3
11 12