SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Addict sdleihssirhc's Avatar
    Join Date
    Feb 2009
    Posts
    387
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Difference Between window and document.defaultView?

    I'm working with getComputedStyle, and realized that I've, at various times, used both of the following:

    Code JavaScript:
    return window.getComputedStyle(elem, null);
    return document.defaultView.getComputedStyle(elem, null);

    Is there any difference between the two? Even in edge cases, like frames, XML, etc.

    Bonus Question: If we can just use the "window.getComputedStyle" syntax, then couldn't we also just use "getComputedStyle"?

  2. #2
    SitePoint Guru
    Join Date
    Apr 2006
    Posts
    802
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    document.defaultView===window

    /* firefox returned value: (Boolean)
    true
    */


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •