Angus wrote on 16 apr 2007 in comp.lang.javascript
:
I tried this:
[..]
No that this helps you find userfunctions,
but perhaps someone can explain
this difference between window and document,
where appending with (document.f + ' ') gives undefined(!!!) [IE7]:
===========================
<div id=d><br></div>
<hr>
<div id=e><br></div>
<script type='text/javascript'>
function testttttttttttttttttt(){ alert(0); };
var d=document.getElementById('d');
for(var f in window)
d.appendChild(document.createTextNode(window.f + ' '));
var e=document.getElementById('e');
for(var f in document)
e.appendChild(document.createTextNode(window.f + ' '));
</script>
===========================
onbeforeunload onafterprint top location parent offscreenBuffering
frameElement onerror screen event clipboardData onresize defaultStatus
onblur window onload onscroll screenTop onfocus Option length
onbeforeprint frames self clientInformation XMLHttpRequest external
screenLeft opener onunload document closed history Image navigator status
onhelp name
-----------------------------------------------------
namespaces lastModified parentNode nodeType fileCreatedDate
onbeforeeditfocus bgColor oncontextmenu onrowexit embeds scripts
onactivate mimeType alinkColor onmousemove onselectstart oncontrolselect
body protocol onkeypress onrowenter onmousedown vlinkColor URL
onreadystatechange doctype onbeforedeactivate applets fileModifiedDate
onmouseover dir media defaultCharset firstChild plugins onafterupdate
ondragstart oncellchange cookie documentElement nextSibling nameProp
referrer ondatasetcomplete onmousewheel onerrorupdate onselectionchange
lastChild ondblclick onkeyup location forms title onrowsinserted
previousSibling compatMode onmouseup onkeydown onrowsdelete onfocusout
fgColor ondatasetchanged onmouseout parentWindow nodeName
onpropertychange onstop onhelp linkColor onbeforeactivate images
readyState frames all onbeforeupdate onclick childNodes onfocusin anchors
selection fileUpdatedDate domain security fileSize ownerDocument
ondataavailable styleSheets nodeValue attributes activeElement
implementation links URLUnencoded ondeactivate
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)