Javascript:window对象出身何处
作者:veking 来源:csdn 发布时间:2007-08-28 15:16:00
标签:window,javascript
注:文中未表明的地方output 输出都是基于IE6.0,其中表明FF的地方为Mozilla Firefox2.0,还要注意文中的大小写
javascript的构成有三部分:ECMAScript、DOM和BOM
1、其中ECMAScript中所有的对象都是Object对象的实例,下面的例子可以说明问题:
alert(Function instanceof Object); //output "true"
alert(String instanceof Object); //output "true"
2、DOM只是一个API与任何语言无关,它所有的操作都是基于document即文档,看下面的例子:
<div id="test">aaa</div>
<script type="text/javascript">
alert(document.getElementById("test").innerHTML); //output "aaa"
alert(window.document.getElementById("test").innerHTML); //output "aaa"
alert(Document instanceof Window); //nothing output (no error) FF output "false"
</script>
3、BOM(浏览器对象模型)包括:document frames history location navigator screen 对象
alert(location instanceof Window); //nothing output (no error) FF output "false"
抱着最后的希望,再来看一个例子:
alert(Window instanceof Object); //nothing output (no error) FF output "true"
从以上几个例子可以看到,微软完全是自行一套实现的它的javascript(即JScript),和标准相去甚远,就算是
现在的IE7.0也是如此,唉,还是睡觉吧!
补充:可以看出FF的window对象是基于Object对象继承来的,那微软的window对象从和而来呢?说实话到现在我也没弄清楚它是从何而来,真是令人费解啊,如果有谁能知道答案请告诉我一下,谢谢先!
0
投稿
猜你喜欢
- 实例如下所示:import timeimport pickleimport osimport reclass LogIncScaner(ob
- Sjoerd Visscher 发现了一个简洁的 方法 让样式在 IE 中作用到未知的元素上——仅需 JS 创建此未知元素即可:docume
- 程序中常常需要复制一个对象, 按思路应该是这样的a = [1, 2, 3]b = a# [1, 2, 3]print b 已经复制好了,但是
- 首先必须将权重也转为Tensor的cuda格式;然后将该class_weight作为交叉熵函数对应参数的输入值。class_weight =
- asp如何实现当前月份距离以前某个时间的月份数 如今天是2011年1月份,我想知道离2010年3月,计算这中间一共是几个月 最佳答案 <
- 1. echo函数:输出函数,是命令,不能返回值。echo后面可以跟很多个参数,之间用分号隔开,如: echo $myvar1; echo
- 一、前言很多时候,我们都有远程控制电脑的需求。比如正在下载某样东西,需要让电脑在下载完后关机。或者你需要监控一个程序的运行状况等。今天我们就
- 相信很多小伙伴平时写python的时候都是需要调试程序的,出问题了,需要了解函数内部是怎么跑的,而这个时候很多人都会想到在疑惑的地方使用pr
- <html><head><script type="text/javascript" sr
- 这个仿msn的右下角popup提示窗口效果很久以前收集的,现在整理出来给大家分享,需要的朋友可以拿去用,特点,提示窗口内容和js代码分离容易
- 安装一些必要的环境1.下载go sdk (本人装的是1.9) 2.下载golang3.下载git 因为有些依赖 要用 go get 去git
- 通过使用zabbix 日志监控 我发现一个问题 例如oracle的日志有报错的情况 ,通常不会去手动清理 这样的话当第二次有日志写进来的时候
- 导语幼儿园升小学,小学升中学,中学升高中..........每个人都要经历的九年义务教育:伴随的都是作业、随堂考、以及每个科目的大大小小的考
- mysql行转列、列转行 语句不难,不做多余解释了,看语句时,从内往外一句一句剖析行转列 &nb
- import timeimport paramikoclass HandleParamiko: '''
- 打算切换某个网站的主机,没想到遇到Php和Mysql中文乱码的问题。 以前的国外主机用的Mysql是4.x系列的,感觉还比较好,都无论GBK
- 前言序号算是在展示数据的时候,一种很普遍的属性了,我们可以自己写生成序号的规则,也可以借助第三方。这里我选择后者,使用Element-UI自
- 目录简介开发工具实现代码爬取效果Github地址:简介使用Python Tkinter开发一个爬取B站直播弹幕的工具,启动后在弹窗中输入房间
- golang拾遗主要是用来记录一些遗忘了的、平时从没注意过的golang相关知识。很久没更新了,我们先以一个谜题开头练练手:package
- 前言本人曾对 Vuex 作过详细介绍,但是今天去回顾的时候发现文章思路有些繁琐,不容易找到重点。于是,在下班前几分钟,我对其重新梳理了一遍。