Jump to content

DispatchEvent error


code0n
 Share

Recommended Posts

i have make an button object inside which event listener , enable, disable activity is being done and when i m making an object of button inside the another object i.e., ui.js then it is showing

a.dispatchEvent is not a function(). Help me to get out of it1919633378_Screenshot(138).png.d73bedb4f6ca7c9fb52ce8d0344edca2.png

Link to comment
Share on other sites

Hi @code0n

https://developer.mozilla.org/en-US/docs/Web/Guide/Events/Creating_and_triggering_events This is a good resource on using `dispatchEvent`. 

However, generally speaking, using `dispatchEvent` (in application code) is a bit of a code smell i.e. there are probably better ways to achieve what you want than 'faking' a DOM event.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...