javascript - new Event('build') vs new CustomEvent('build') -


on mdn page creating , triggering events shows example of creating event event or customevent. explains customevent allows custom details, other that, doesn't much.

so, difference? if i'm creating generic scroll event, should use customevent? or events not exist in javascript?

also, noticed mouseevent child of event, if i'm creating click event, can use new mouseevent('click')?

thanks

from guide:

to add more data event object, customevent interface exists , detail property can used pass custom data.

you can use event() anything. if want attach custom data, use customevent('eventname', {data}).

and yes, mouse-events, should use mouseevent.


Comments

Popular posts from this blog

shopping cart - Page redirect not working PHP -

php - How to modify a menu to show sub-menus -

python - Installing PyDev in eclipse is failed -