Re: Accessing the global object



On Feb 24, 8:25 pm, "Richard Cornford" <Rich...@xxxxxxxxxxxxxxxxxxx>
wrote:
Peter Michaux wrote:

<snip>

The overwhelming majority of JavaScript hosts are web
browsers. Simple as that.

There is quite a tangled question of how you would set about counting
something that has very debatable substance. The worlds second most common
javascript host (note that is not capitalised into the trademark name, for
any pedants reading) must be windows scripting host. I say that because by
default it gets installed on every individual machine running Windows. Of
course that just means the software for WSH is on a very larger number of
hard disks. The bulk of people using Windows don't know they have WSH and so
never execute it (and a fair few that know they have it will never execute
it as well). So what would be being counted? Bytes stored on some sort of
media (how many AOL CDs have been distributed with a browser's code stored
on them), executing code, executed code, code that is executing at this
precise time, code stored in a way that gives it the potential to be
executed (as opposed to sitting at the bottom of a landfill)?

You can argue the definitions of terms forever (because you can always argue
about the terms used to argue about the first terms, and so on recursively).
The bottom line is that it is impossible to prove anything (except maybe in
mathematics), but if a statement has testable consequences it can be
demonstrated to be false. Thus knowledge grows by the elimination of the
things that can be shown to be false from the set of things that are
believed to be known (where the set of things that are believed to be know
does not include things that are metaphysical, as they are just believed (or
not)).

In the context of generalisations about web browsers the single example of a
browser being an exception is precisely the sort of thing that is needed to
falsify the generalisation. A good example might be the proposed
generalisation that the - DefaultView - property of documents specified in
the W3C Views DOM is always a reference to the ECMAScript global object

Yes, I have heard that it is a bad assumption that
document.defaultView == window.

(and/or the window/frame object). That generalisation is shown to be false
by IceBrowser 5, where the document's - DefaultView - property refers to an
object that fully implements the W3C specified interface for the object but
is not the ECMAScript global object/window object. There may be other
browsers were that is also the case, or there may not. That does not matter
because the single example is enough to falsify the generalisation (thus you
can stop looking after finding the first).


Is there a property of document in IceBrowser that leads to its parent
window? IE has the parentWindow property and defaultView is the only
other option I know of to find the appropriate window object (though
apparently it is not 100% reliable.) I don't often have the need to
find the parent window of a random document, but I would like to know
if there is a more reliable way to do it.
.



Relevant Pages

  • Re: Accessing the global object
    ... default it gets installed on every individual machine running Windows. ... never execute it (and a fair few that know they have it will never execute ... In the context of generalisations about web browsers the single example of a ... falsify the generalisation. ...
    (comp.lang.javascript)
  • Re: IE leaks, circular references, addevent et al
    ... knowing whether client does in fact support corresponding events. ... array of such `window` objects? ... Safari due to missing `compatMode` there, ... // Result is ambiguous in all but modern browsers, ...
    (comp.lang.javascript)
  • Re: "Access is denied" using dhtml - window.moveTo( 0, 0);
    ... I have a web page called www.dn.se as the browsers ... Thanks, Ardax ... >> The window object is the top window for several underlying frames. ... To use window.onerror but it will not fire the event. ...
    (microsoft.public.scripting.jscript)
  • Re: Password dialog window popping up
    ... It's happening with both Mozilla Firefox and Nestcape browsers. ... This window requests username and password for random odd web addresses. ... As I said, I've never seen these before yesterday, it's been forever since I've seen a popup window at all. ...
    (microsoft.public.security)
  • Re: No solution?
    ... Well, if you're saying you haven't been able to execute /wuforce yet, then ... open Command prompt window. ... Faulting Application svchost.exe version 5.1.2600.2180 ... Searching Google for your error message "faulting-module" AND wuaueng.dll ...
    (microsoft.public.windowsxp.security_admin)