Skip to main content

Bug Tracker

Side navigation

#2708 closed enhancement (fixed)

Opened April 17, 2008 08:14PM UTC

Closed April 22, 2008 10:08PM UTC

Cross Browser event object

Reported by: narcvs Owned by:
Priority: major Milestone: 1.2.4
Component: core Version: 1.2.3
Keywords: Event, Timestamp Cc:
Blocked by: Blocking:
Description

When attaching an event, e.g. keydown, to an element using bind or keydown, the event object that gets passed in at trigger time is not cross browser. Notably, the timeStamp object does not have a value in IE 5/6, and is 0 in Opera 9.27.

Is there a concensus on making the event object cross platform, or leaving it as is? The timeStamp feature is very convenient for certain purposes, and should be reliable.

A possible fix would be to give it value

e.timeStamp = e.timeStamp || Number(new Date())

before passing it on to the event handler.

Attachments (0)
Change History (3)

Changed April 17, 2008 08:19PM UTC by narcvs comment:1

That's supposed to be

e.timeStamps = e.timeStamp || Number(new Date())

Silly me.

Changed April 22, 2008 08:57PM UTC by flesler comment:2

You wrote timeStamps the first time.

Anyway.. I think this is enough:

e.timeStamp = e.timeStamp || +new Date;

Changed April 22, 2008 10:08PM UTC by joern comment:3

resolution: → fixed
status: newclosed

Fixed in [5280].