---
title: "JavaScript （2）"
author: "IT_Justin"
date: "2014-02-16T13:12:00Z"
tags: []
categories: ["Web前端"]
slug: "javascript-2"
draft: false
lastmod: "2014-02-16T13:14:29Z"
id: 2017701
url: "https://it-justin.iteye.com/blog/2017701"
---

**JavaScript对象**

 

█Window 对象

Window 对象表示浏览器中打开的窗口。如果文档包含框架（frame 或 iframe 标签），浏览器会为 HTML 文档创建一个 window 对象，并为每个框架创建一个额外的 window 对象。

var w=window.innerWidth|| document.documentElement.clientWidth|| document.body.clientWidth;

var h=window.innerHeight|| document.documentElement.clientHeight|| document.body.clientHeight;

上面的w和h分别是记录浏览器的宽和高.

 

█Navigator 对象

 

█

█

█

█

█

██

██

█

██

██

█

███

██████████

███