#123 ✓resolved
nickg

PATCH: do not use "document.all" internally

Reported by nickg | March 21st, 2010 @ 05:30 AM

Commit
http://github.com/client9/env-js/commit/c773fe455388790834ab3110ca0...
(and the fix for typo I made) http://github.com/client9/env-js/commit/b055686d253a432b313397c8c3c...

Makes envjs not use "document.all" / "this.all" (and instead uses it's equivalent)

Why you ask? Some lovely javascripts use the existence of document.all to see if the browser is MSIE. all is a MSIE specific API, so one should be able to turn it on or off as needed.

In my application code, I got around this with:

// Some old sniffers use document.all to verify                                                                                                           
// an environment is MSIE!
// http://www.udm4.com/ is an example
if (Envjs.userAgent.indexOf('MSIE') == -1) {

delete document.all;



}

But this explodes since all is used internally by getElementById and getElementsByName (yes, they are making a node list and iterating through it -- yes that could be improved, but not today ;-)
). Anyways, this replaces use of this.all with this.getElementsByTagName('*'); (which is what all did).

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 ยป

a javascript browser environment

People watching this ticket

Pages