javascript 에서 window 객체가 최상위 객체라고 하길래
어떤 객체들이 있나, 어떤 함수들이 있나 for...in 을 이용해서 출력했다.
하지만 출력하다 죽는 문제가 있어 해결방법을 찾던중
try..catch 문이란게 있었고 e.message 로 메시지를 출력하면 계속 진행하는 것을 발견했다.
음.. 문법은 거의 C++에 가까운 느낌이라고 해야하나..
<html>
<script type="text/javascript">
document.write("<hr><H1>window</H1>");
for (i in window)
{
try
{
if(typeof(window[i]) == 'object')
document.write("<B>",i,"</B><br>");
else document.write(window[i], "<br>");
}
catch(e)
{
document.write(i,"-");
document.write("<font color=red>",e.message, "</font><br>");
}
}
document.write("<hr><H1>document</H1>");
for (i in document)
{
try
{
if(typeof(document[i]) == 'object')
document.write("<B>",i,"</B><br>");
else document.write(document[i], "<br>");
}
catch(e)
{
document.write(i,"-");
document.write("<font color=red>",e.message, "</font><br>");
}
}
document.write("<hr><H1>location</H1>");
for (i in location)
{
try
{
if(typeof(location[i]) == 'object')
document.write("<B>",i,"</B><br>");
else document.write(location[i], "<br>");
}
catch(e)
{
document.write(i,"-");
document.write("<font color=red>",e.message, "</font><br>");
}
}
document.write("<hr><H1>history</H1>");
for (i in history)
{
try
{
if(typeof(history[i]) == 'object')
document.write("<B>",i,"</B><br>");
else document.write(history[i], "<br>");
}
catch(e)
{
document.write(i,"-");
document.write("<font color=red>",e.message, "</font><br>");
}
}
document.write("<hr><H1>navigator</H1>");
for (i in navigator)
{
try
{
if(typeof(navigator[i]) == 'object')
document.write("<B>",i,"</B><br>");
else document.write(navigator[i], "<br>");
}
catch(e)
{
document.write(i,"-");
document.write("<font color=red>",e.message, "</font><br>");
}
}
</script>
</html>
Firefox / IE8
window
function getInterface() {
[native code]
} window document navigator netscape
function
XPCSafeJSObjectWrapper() {
[native code]
}
function XPCNativeWrapper() {
[native code]
} Components
sessionStorage-Operation is
not supported globalStorage
function
getComputedStyle() {
[native code]
}
function dispatchEvent() {
[native code]
}
function removeEventListener() {
[native code]
}
parent top
function dump() {
[native code]
}
function getSelection() {
[native code]
}
function scrollByLines() {
[native code]
} scrollbars
0
0
function scrollTo() {
[native code]
}
function scrollBy() {
[native code]
}
function scrollByPages() {
[native code]
}
function sizeToContent() {
[native code]
}
function setTimeout() {
[native code]
}
function setInterval() {
[native code]
}
function clearTimeout() {
[native code]
}
function clearInterval() {
[native code]
}
function setResizable() {
[native code]
}
function captureEvents() {
[native code]
}
function releaseEvents() {
[native code]
}
function routeEvent() {
[native code]
}
function enableExternalCapture() {
[native code]
}
function disableExternalCapture() {
[native code]
}
function open() {
[native code]
}
function openDialog() {
[native code]
} frames applicationCache self screen history content menubar toolbar locationbar personalbar statusbar directories
false crypto pkcs11 controllers opener
location
1074
762
1082
895
159
42
163
149
0
0
0
577
0
false
function
alert() {
[native code]
}
function confirm() {
[native code]
}
function prompt() {
[native code]
}
function focus() {
[native code]
}
function blur() {
[native code]
}
function back() {
[native code]
}
function forward() {
[native code]
}
function home() {
[native code]
}
function stop() {
[native code]
}
function print() {
[native code]
}
function moveTo() {
[native code]
}
function moveBy() {
[native code]
}
function resizeTo() {
[native code]
}
function resizeBy() {
[native code]
}
function scroll() {
[native code]
}
function close() {
[native code]
}
function updateCommands() {
[native code]
}
function find() {
[native code]
}
function atob() {
[native code]
}
function btoa() {
[native code]
} frameElement
function showModalDialog() {
[native code]
}
function postMessage() {
[native code]
}
function addEventListener() {
[native code]
} localStorage
0-Ð History.item 1 8X0 p
1
current-Ð History.current 1
previous-Ð History.previous 1
next-Ð History.next 1
function
back() {
[native code]
}
function forward() {
[native code]
}
function go() {
[native code]
}
function item() {
[native code]
}
history
1
navigator
Mozilla
Netscape
5.0 (Windows; ko)
ko mimeTypes
Win32
Windows
NT 5.1
Gecko
20100625 plugins
Mozilla/5.0
(Windows; U; Windows NT 5.1; ko; rv:1.9.2.6) Gecko/20100625
Firefox/3.6.6 ( .NET CLR 3.5.30729)
true
true
20100625231939
function
javaEnabled() {
[native code]
}
function taintEnabled() {
[native code]
}
function preference() {
[native code]
} geolocation
function registerContentHandler() {
[native code]
}
function registerProtocolHandler() {
[native code]
}
function mozIsLocallyAvailable() {
[native code]
}
navigator
Mozilla
Microsoft Internet
Explorer
0
x86
Win32 plugins opsProfile userProfile
ko
ko
4.0
(compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 2.0.50727; .NET CLR
3.0.4506.2152; .NET CLR 3.5.30729)
Mozilla/4.0 (compatible; MSIE 8.0; Windows
NT 5.1; Trident/4.0; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR
3.5.30729)
true
true mimeTypes
null, a special keyword denoting a null value; null is also a primitive value.
Because JavaScript is case-sensitive, null is not the same as Null, NULL, or
any other variant l undefined, a top-level property whose value is undefined; undefined is also a primitive value