Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6063967
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T09:13:41+00:00 2026-05-23T09:13:41+00:00

My web application uses document.createEvent and event.initEvent to create custom events of the generic

  • 0

My web application uses document.createEvent and event.initEvent to create custom events of the generic type Event.

I wonder whether this is considered good practice. On the hand side, this way I can make use of the DOM event system that is already there and do not have to invent and implement my own; on the other hand this may lead to name clashes in case future standardised event models define an event type with the name I have chosen. (Or is it possible to namespace event types?)

I am asking because I have just learnt by browsing stackoverflow that putting custom properties on DOM objects or builtin Javascript objects is considered bad practise.

EDIT
I think I have found something:
http://dev.w3.org/2006/webapi/DOM-Level-3-Events/html/DOM3-Events.html#events-CustomEvent

So let me rephrase my question: Am I understanding the quoted section correctly in that it is advised to actually use a CustomEvent inside a web application?

ADDED WARNING
I have just noticed that CustomEvent is not supported in Firefox versions before 6. It is supported in current Webkit-based browsers, though.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T09:13:42+00:00Added an answer on May 23, 2026 at 9:13 am

    If you’re going to create something and make it as namespace-proof as you can, you can do what Webkit and Mozilla do and add a name-moniker to the beginning of all of your event names. Like:

    _marc_trap_door_shut
    _marc_trap_door_open
    _marc_trap_door_ajar
    ... etc ...
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a web application that uses a library which resides in TOMCAT_HOME/common/lib. This
I have a web application that uses a couple of PDF forms to create
I have a web application uses a proxy to invoke an operation on a
I have a web application that uses TONS of javascript, and as usual, there
I have a web application that uses AzMan authorization to grant different functionality to
I have a web application that uses two databases. DB1 Users perform their CRUD
I have a web application that uses the CDO Message object to email reports.
We have a web application that uses dropbox as file storage. We have currently
I have a web application that uses the Spring Framework (3.1) and persistence through
I have a php web application that uses big cookies to store a lot

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.