zoukankan      html  css  js  c++  java
  • TWebBrowser 与 MSHTML(5): document 对象的属性、方法、事件纵览


    {IHTMLDocument2 方法:}
    write                 //写入
    writeln               //写入并换行
    open                  //打开一个流,以收集 document.write 或 document.writeln 的输出
    close                 //关闭并输出用 document.open 方法打开的流
    clear                 //清空文档中所有元素, 可能暂时不支持
    queryCommandSupported //是否支持指定命令
    queryCommandEnabled   //指定命令是否有效
    queryCommandState     //是否设置了指定命令
    queryCommandIndeterm  //指定命令是否处于不确定状态
    queryCommandText      //命令
    queryCommandValue     //命令值
    execCommand           //执行命令
    execCommandShowHelp   //命令帮助信息
    createElement         //建立元素
    elementFromPoint      //指定坐标下的元素
    createStyleSheet      //创建一个样式表
    
    {IHTMLDocument2 属性:}
    all                   //所有 HTML 元素的集合
    images                //所有 image 对象的集合
    applets               //所有 applet 对象的集合
    links                 //所有 link 对象的集合
    forms                 //所有 form 对象的集合
    anchors               //所有 anchor 对象的集合
    scripts               //所有 script 对象的集合
    frames                //所有 frame 对象的集合, 这应该和 window.frames 是一样的
    embeds                //所有 embed 对象的集合
    plugins               //所有 plugin 对象的集合
    styleSheets           //样式表集合
    title                 //网页标题
    body                  //body 对象
    activeElement         //当前具有输入焦点的元素
    designMode            //设计模式, 可选值: Inherit On Off
    selection             //当前选择
    readyState            //页面读取状态: uninitialized、loading、loaded、interactive、completed
    linkColor             //链接的颜色
    alinkColor            //活动链接的颜色
    vlinkColor            //已访问过的链接的颜色
    bgColor               //背景颜色
    fgColor               //文本颜色
    referrer              //返回载入当前页面的页面的 URL
    location              //同 window.location
    lastModified          //返回文档最后修改的日期和时间
    url                   //返回当前文档的 URL
    domain                //返回域名
    cookie                //返回文档相关的 cookie
    expando               //可设置与获取的布尔值, 是否允许扩展
    charset               //获取文档的字符集名称
    defaultCharset        //获取浏览器默认的字符集名称
    mimeType              //文档类型
    fileSize              //文档大小, 单位字节, 用字符串表示
    fileCreatedDate       //文档建立时间 ???
    fileModifiedDate      //文档修改时间 ???
    fileUpdatedDate       //文档更新时间 ???
    security              //文档安全
    protocol              //传输协议
    nameProp              //文件标题, 好像同 Title
    parentWindow          //父窗口
    Script                //
    
    {IHTMLDocument2 事件:}
    onhelp                //用 F1 获取帮助时
    onclick               //单击时
    ondblclick            //双击时
    onmousedown           //鼠标点下时
    onmouseup             //鼠标抬起时
    onmousemove           //鼠标移动时
    onmouseover           //鼠标进入时
    onmouseout            //鼠标离开时
    onkeypress            //按键时
    onkeyup               //键按住时
    onkeydown             //键抬起时
    onreadystatechange    //状态改变时
    onrowexit             //当前数据源的数据将要发生变化时
    onrowenter            //当前数据源的数据发生变化并且有新的数据时
    ondragstart           //开始拖动时
    onselectstart         //开始选择时
    onbeforeupdate        //更新前
    onafterupdate         //更新后
    onerrorupdate         //更新错误时
    
    
    {IHTMLDocument3 方法:}
    recalc                //重新获取文档中的全部动态属性
    releaseCapture        //释放文档中对象的鼠标捕捉
    
    {IHTMLDocument3 属性:}
    createTextNode        //建立文本
    attachEvent           //绑定事件
    detachEvent           //取消事件绑定
    createDocumentFragment//创建新文档
    getElementsByName     //返回带有指定 name 的对象集合
    getElementById        //返回指定 id 的第一个对象的引用
    getElementsByTagName  //返回指定标签的对象集合
    documentElement       //获取文档根部节点, 也就是 HTML 节点
    uniqueID              //获取对象的唯一标识符
    dir                   //
    parentDocument        //
    enableDownload
    baseUrl               //基础地址
    
    {IHTMLDocument3 事件:}
    onrowsdelete          //当前数据记录被删除时
    onrowsinserted        //当前数据源将要插入新数据时
    oncellchange          //当数据来源发生变化时
    ondatasetchanged      //数据源发生变化时
    ondataavailable       //当数据接收完成时
    ondatasetcomplete     //当数据源的全部有效数据读取完毕时
    onpropertychange      //改变属性时
    oncontextmenu         //当按下鼠标右键出现菜单或通过键盘触发页面菜单时
    onstop                //停止或离开时
    
    
    {IHTMLDocument4 方法:}
    focus                 //获得输入焦点
    hasFocus              //是否拥有输入焦点
    createDocumentFromUrl //下载指定网页并返回其 IHTMLDocument2 接口
    CreateEventObject     //生成当使用 fireEvent 方法时用于传递事件相关信息的 event 对象 ???
    FireEvent
    
    {IHTMLDocument4 属性:}
    createRenderStyle     //建立 IHTMLRenderStyle 接口
    namespaces            //
    media                 //
    URLUnencoded          //获取去除字符编码的 URL
    
    {IHTMLDocument4 事件:}
    onselectionchange     //改变选择时
    oncontrolselect       //好像是框选时
    
    
    {IHTMLDocument5 方法:}
    createAttribute       //建立指定 name 的属性
    createComment         //建立注释
    
    {IHTMLDocument5 属性:}
    doctype               //文档类型
    implementation_       //获取 IHTMLDOMImplementation 接口
    compatMode            //兼容模式, 返回 BackCompat、CSS1Compat 等
    
    {IHTMLDocument5 事件:}
    onmousewheel          //旋转鼠标滚动轮时
    onfocusin             //获取输入焦点时
    onfocusout            //失去输入焦点时
    onactivate            //激活时
    ondeactivate          //当前对象变为父文档的其他对象时
    onbeforeactivate      //onactivate 前
    onbeforedeactivate    //ondeactivate 前
    
  • 相关阅读:
    SQL SERVER 2008 SA禁用,Windows帐户被删
    SQL Server表结构修改脚本
    请教高手,如何取得Target属性
    Installing Reporting Services on Windows 7, Vista or Windows Server 2008 无权限(rsAccessDenied)解决方法
    请教:如何在子页面关闭时把焦点设置到父页面的服务器控件上?
    order by newid() sql随机查询
    JS干货,笔记大全
    破解XP密码
    直接连接*.mdf 文件 获取随机数据
    总结C#获取当前路径的7种方法(转)
  • 原文地址:https://www.cnblogs.com/del/p/1413597.html
Copyright © 2011-2022 走看看