Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

PATCH: do not use "document.all" internally

#123

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).

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

State: resolved
Milestone: none
Assigned to: nickg nickg

Activity

  1. nickg
    nickg

    wow, wiki did not like that. let me try again

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

    March 21st, 2010 @ 05:34 AM

  2. nickg

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.