Re: How to get a list of the events an object can emit, in Firefox?



Good morning ;-)

Sam Dutton replied to an article written over a month ago (no offense taken):
Thomas 'PointedEars' Lahn wrote:
Sam wrote:
I'm trying to find out theeventsthat a video element can emit in
Firefox 3.1 (other than by looking at the documentation!)
What is a video element?

For page elements in Internet Explorer I can use...
for (prop in obj)
document.write(prop);
.... and this gives alistofevents(in the form of onclick, etc.)
In Firefox, I get alistof properties this way, but noevents.
Probably you mean (proprietary) *event-handler properties* instead.
The naming in (the) MSHTML (documentation) is misleading.

Am I missing something obvious?
Yes.

[...]
2. The object iterated over is a *host object*.
[...]
4. You seem to have forgotten to declare `prop', which is error-prone:

for (var prop in obj)

Thanks for your response.

Thanks for quoting properly next time. <http://jibbering.com/faq/#posting>

Excuse my ignorance, but what does 2. mean?: "The object iterated over
is a *host object*"

It means exactly that (the asterisks mark the emphasis). See the ECMAScript
Language Specification, Edition 3 Final, sections 4.3.8 and 8.6.2. What it
means for your approach is that you cannot assume that this will work; in
fact, it might as well break.

HTML 5 has a video and audio elements, which are supported (more or
less) by new or beta browsers.determine

Which because of the latter are certainly unwise to use on the Web. As for
the former, HTML 5 is not even a Candidate Recommendation yet, let alone
that Web developers or responsible working groups would have come to an
agreement about whether it is a rather good idea or a recipe for disaster
instead. (IMHO, a specification for DOM scripting does not belong in a
specification for a markup language to begin with.)

I'm still wondering if there's a way to find a list of the events (if
that's the right word!)

That is the right word, however `on...' are named event handlers for those
events, and the values that you assign to them (callable objects) are named
event listeners. Always keep those separate to avoid confusion (MSDN
unfortunately didn't.)

that an element can emit. In the case of the video and audio elements,
this means timeupdated, seeked, etc.

That is probably highly dependent on the required and used media plugins,
and therefore documented there. RTFM. However, it might be possible to
determine with a feature test which properties the corresponding host object
supports in the respective runtime environment.

RTFFAQ: <http://jibbering.com/faq/>


PointedEars
.



Relevant Pages

  • Re: Nokia 6500 Classic stereo headphones adapter problem
    ... documentation that theNokia6500Classiccan do both a host and non- ... your audio adapter to your PC as a client, if indeed that is how it is ... problem according to Nokia's documentation. ... based on the Series 40 platform, support USB audio devices. ...
    (sci.electronics.repair)
  • Re: Nokia 6500 Classic stereo headphones adapter problem
    ... documentation that theNokia6500Classiccan do both a host and non- ... your audio adapter to your PC as a client, if indeed that is how it is ... problem according to Nokia's documentation. ... based on the Series 40 platform, support USB audio devices. ...
    (sci.electronics.repair)
  • Re: Nokia 6500 Classic stereo headphones adapter problem
    ... documentation that theNokia6500Classiccan do both a host and non- ... problem according to Nokia's documentation. ... "The Nokia 6500 Classic and Nokia 8800 Arte mobile phones, ... based on the Series 40 platform, support USB audio devices. ...
    (sci.electronics.repair)
  • Re: references to OTHER objects
    ... perldoc search engine is because everyone has a 'best' way of searching ... for the documentation. ... Horror of horrors, if you used a browser such as Firefox, ...
    (comp.lang.perl.misc)
  • Re: class with __len__ member fools boolean usage "if x:" ; bad coding style?
    ... >> as a sequence, I fear you in for even subtler bugs... ... > on the Host itself, to check whether the Host has timed out. ... In Python, you don't normally check for a timeout, you'd ... No amount of documentation can heal an unintuitive API. ...
    (comp.lang.python)

Loading