#11 ✓duplicate
cwolves

Event handlers fail if run before document is loaded

Reported by cwolves | April 15th, 2008 @ 12:08 AM

Prototype 1.6.0.2

Event is dependent on document.body existing which, in IE (of course) isn't always the case if the event is fired before the document is fully loaded.

Simple test case is to make a mouseMove event handler on an object and to fire it before the document is loaded. Prototype chokes on line 3788:

... || document.body.scrollLeft

// document.body == null

This should be something along the lines of:

... || (document.body?document.body.scrollLeft:0)

Comments and changes to this ticket

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

The Prototype JavaScript library.

Shared Ticket Bins

Referenced by

Pages