zoukankan      html  css  js  c++  java
  • BOM

    一 BOM >>> brower objects model

    window: frames[]::  框架

        histore : 历史记录

        location 本地信息>>> 浏览器地址栏的内容

        navigator::  获取客户端属性

        screem :  ,屏幕,显示

        DOM:   document:  anchors[]   锚点 (超链接)

                   forms[] :表单

                 applets: []Applet 是一种 Java 程序。它一般运行在支持 Java 的 Web 浏览器内。因为它有完整的 Java API支持,所以Applet 是一个全功能的                                 Java 应用程序。

                 images[] : 图片

                 areas[] :区块

                 layers [] : 层

                 embeds[] : 嵌套

                 links[] :外链

    二 window对象是js中的顶级对象 

      Window方法:  alert   confirm   prompt   open ("链接",  打开方式(target)(-self/ _blank....))

            .close() #关闭页面

                 

    三 location: 可以将URL解析成独立的片段

      方法: href 跳转

         hash  返回url中 # 后面的内容, 包含#

          host :  主机名 +端口号

            hostname : 主机名

           pathname:  url中路径部分,   (如www.baidu.com/ a   >>>a部分 )

         protocol: 协议  (http://   https://    等)

           search  : 查询字符串

       for E   : href    location.href =  "http://www.baidu.com/";    在当前页面打开百度

          location.reload() #重新加载页面

    四  : nabigator对象

       userAgent: 系统+ 浏览器信息

      platform:  浏览器支持的系统, win/mac/linux

    五 history:  历史

      1: 后退: history.back()

        history.go(-1):0   >>> 0是刷新

      2前进:  history.forward()

           history.go(1)

    六 其他:   client (DOM对象属性)  :   object.clientTop :  内容区域(包括padding)  到边框顶部的距离,   上boder-top 的宽度            

                      .clientLeft:  左边边框的宽度

                      .clientWidth:   内容区域+左右padding:  可视宽度

                      .clientHeitght: 内容区域+上下padding:  可视高度

        

        onresize:  窗口发生大小变化事件

        offset : Dom对象,  object.offsetTop:   如果盒子没有设置定位,  到body的顶部的距离,   如过有定位,  就是magin-top

                   offsetWidth:  占位宽>>内容加paddind+boder

                   offsetHeight: 占位高 ,  padding + height +boder

                   offserLeft:  如果没有设置定位, magin-left  到body   若果有定位, 以父辈盒子为准

         scroll  : scrollTop:    页面卷起的高度

            scrollLeft:  页面卷起的左侧

            scrollWidth:  页面卷起的宽度

            scrollLeftHeight: height+ paddiong 不含边框  滚定监听是发生变化

  • 相关阅读:
    四种常用正则表达式
    解读tomcat的server.xml文件
    存储过程与函数的区别
    Servlet如何处理一个请求?
    Oracle归档模式相关
    常用几个Struts2标签
    Js中比较时间大小
    传值出现中文乱码问题
    JAVA常用转义符
    HDU 5967(LCT)
  • 原文地址:https://www.cnblogs.com/tcpblog/p/9948748.html
Copyright © 2011-2022 走看看