js實現(xiàn)瀏覽器的各種菜單命令比如打印、查看源文件等等
更新時間:2013年10月24日 09:51:11 作者:
瀏覽器的各種菜單命令比如打印、查看源文件、加入收藏等等,這些在js中時完全可以實現(xiàn)的,本文搜集整理了一些,感興趣的朋友可以參考下
復制代碼 代碼如下:
input type="button" onclick="document.execCommand('open')" value=打開
input type="button" onclick="document.execCommand('saveas')" value=保存
input type="button" onclick="document.execCommand('print')" value=打印
input type="button" onclick="document.execCommand('selectall')" value=全選
input type="button" onclick="location.replace('view-source:'+location)" value=源文件
input type="button" onclick="window.external.ShowBrowserUI('PrivacySettings',null)" value=安全選項
input type="button" onclick="window.external.ShowBrowserUI('LanguageDialog', null)" value=語言設置
input type="button" onclick="window.external.AddFavorite(location.href, document.title)" value=加入收藏夾
input type="button" onclick="window.external.ShowBrowserUI('OrganizeFavorites', null)" value=整理收藏夾
input type="button" value=刷新 name=refresh onclick="window.location.reload()">
input type="button" value=導入收藏夾 onclick=window.external.ImportExportFavorites(true,'');
input type="button" value=導出收藏夾 onclick=window.external.ImportExportFavorites(false,'');
相關文章
JavaScript函數(shù)的4種調(diào)用方法詳解
了解函數(shù)的調(diào)用過程有助于深入學習與分析JavaScript代碼。本文是JavaScript高級這個系列中的第三篇文章,主要介紹JavaScript中函數(shù)的四種使用形式2014-04-04
JavaScript實現(xiàn)多個重疊層點擊切換效果的方法
這篇文章主要介紹了JavaScript實現(xiàn)多個重疊層點擊切換效果的方法,實例分析了javascript實現(xiàn)點擊切換效果的相關技巧,需要的朋友可以參考下2015-04-04
細說webpack源碼之compile流程-入口函數(shù)run
Webpack 是一個前端資源加載/打包工具。它將根據(jù)模塊的依賴關系進行靜態(tài)分析,然后將這些模塊按照指定的規(guī)則生成對應的靜態(tài)資源。這篇文章主要介紹了webpack源碼之compile流程-入口函數(shù)run,需要的朋友可以參考下2017-12-12
獲取任意Html元素與body之間的偏移距離 offsetTop、offsetLeft (For:IE5+ FF1 )[
獲取任意Html元素與body之間的偏移距離 offsetTop、offsetLeft (For:IE5+ FF1 )[...2006-12-12

