zoukankan      html  css  js  c++  java
  • 打开,另存为,属性,打印等14个JS代码

    ■打开■ 
    <input name=Button onClick=document.all.WebBrowser.ExecWB(1,1) type=button value=打开> 
    <OBJECT classid=CLSID:8856F961-340A-11D0-A96B-00C04FD705A2 height=0 id=WebBrowser width=0></OBJECT> 
    ■另存为■ 
    <input name=Button onClick=document.all.WebBrowser.ExecWB(4,1) type=button value=另存为><OBJECT classid=CLSID:8856F961-340A-11D0-A96B-00C04FD705A2 height=0 id=WebBrowser width=0></OBJECT> 
    ■属性■ 
    <input name=Button onClick=document.all.WebBrowser.ExecWB(10,1) type=button value=属性><OBJECT classid=CLSID:8856F961-340A-11D0-A96B-00C04FD705A2 height=0 id=WebBrowser width=0></OBJECT> 
    ■打印■ 
    <input name=Button onClick=document.all.WebBrowser.ExecWB(6,1) type=button value=打印><OBJECT classid=CLSID:8856F961-340A-11D0-A96B-00C04FD705A2 height=0 id=WebBrowser width=0></OBJECT> 
    ■页面设置■ 
    <input name=Button onClick=document.all.WebBrowser.ExecWB(8,1) type=button value=页面设置><OBJECT classid=CLSID:8856F961-340A-11D0-A96B-00C04FD705A2 height=0 id=WebBrowser width=0></OBJECT> 
    ■刷新■ 
    <input type=button value=刷新 name=refresh onclick="window.location.reload()"> 
    ■导入收藏■ 
    <input type="button" name="Button" value="导入收藏夹" onClick=window.external.ImportExportFavorites(true,);> 
    ■导出收藏■ 
    <input type="button" name="Button3" value="导出收藏夹" onClick=window.external.ImportExportFavorites(false,);> 
    ■加入收藏■ 
    <INPUT name=Button2 onclick="window.external.AddFavorite(location.href, document.title)" type=button value=加入收藏夹> 
    ■整理收藏夹■ 
    <INPUT name=Submit2 onclick="window.extern




    WebBrowser.ExecWB(1,1) 打开
    WebBrowser.ExecWB(2,1) 关闭现在所有的IE窗口,并打开一个新窗口
    WebBrowser.ExecWB(4,1) 保存网页
    WebBrowser.ExecWB(6,1) 打印
    WebBrowser.ExecWB(7,1) 打印预览
    WebBrowser.ExecWB(8,1) 打印页面设置
    WebBrowser.ExecWB(10,1) 查看页面属性
    WebBrowser.ExecWB(15,1) 好像是撤销,有待确认
    WebBrowser.ExecWB(17,1) 全选
    WebBrowser.ExecWB(22,1) 刷新
    WebBrowser.ExecWB(45,1) 关闭窗体无提示

    这些只对IE5.5以上版本有效,我是在IE6下测试的,通过的。

    代码:


    ■打开■
    <input name=Button onClick=document.all.WebBrowser.ExecWB(1,1) type=button value=打开>
    <OBJECT classid=CLSID:8856F961-340A-11D0-A96B-00C04FD705A2 height=0 id=WebBrowser width=0></OBJECT>
    ■另存为■
    <input name=Button onClick=document.all.WebBrowser.ExecWB(4,1) type=button value=另存为><OBJECT classid=CLSID:8856F961-340A-11D0-A96B-00C04FD705A2 height=0 id=WebBrowser width=0></OBJECT>
    ■属性■
    <input name=Button onClick=document.all.WebBrowser.ExecWB(10,1) type=button value=属性><OBJECT classid=CLSID:8856F961-340A-11D0-A96B-00C04FD705A2 height=0 id=WebBrowser width=0></OBJECT>
    ■打印■
    <input name=Button onClick=document.all.WebBrowser.ExecWB(6,1) type=button value=打印><OBJECT classid=CLSID:8856F961-340A-11D0-A96B-00C04FD705A2 height=0 id=WebBrowser width=0></OBJECT>
    ■页面设置■
    <input name=Button onClick=document.all.WebBrowser.ExecWB(8,1) type=button value=页面设置><OBJECT classid=CLSID:8856F961-340A-11D0-A96B-00C04FD705A2 height=0 id=WebBrowser width=0></OBJECT>
    ■刷新■
    <input type=button value=刷新 name=refresh onclick="window.location.reload()">
    ■导入收藏■
    <input type="button" name="Button" value="导入收藏夹" onClick=window.external.ImportExportFavorites(true,);>
    ■导出收藏■
    <input type="button" name="Button3" value="导出收藏夹" onClick=window.external.ImportExportFavorites(false,);>
    ■加入收藏■
    <INPUT name=Button2 onclick="window.external.AddFavorite(location.href, document.title)" type=button value=加入收藏夹>
    ■整理收藏夹■
    <INPUT name=Submit2 onclick="window.external.ShowBrowserUI(OrganizeFavorites, null)" type=button value=整理收藏夹>
    ■查看原文件■
    <INPUT name=Button onclick=window.location = "view-source:" + window.location.href type=button value=查看源文件>
    ■语言设置■
    <INPUT name=Button onclick="window.external.ShowBrowserUI(LanguageDialog, null)" type=button value=语言设置>
    ■前进■
    <INPUT name=Submit onclick=history.go(1) type=submit value=前进>
    ■后退■
    <INPUT name=Submit2 onclick=history.go(-1) type=submit value=后退>
  • 相关阅读:
    从外部访问 Template (模板)的控件、获取它的属性值
    继续聊WPF——动态数据模板
    WPF数据模板样式选择器
    深入理解正则表达式
    nssm使用,安装服务、删除服务
    Windows删除某服务
    nssm设置solr开机启动服务
    Windows下直接双击可执行的jar
    Unsupported major.minor version 52.0——解决
    js延迟2秒执行事件
  • 原文地址:https://www.cnblogs.com/5tao/p/474588.html
Copyright © 2011-2022 走看看