JS中操作IE瀏覽器的一些方法整理

來源:互聯網
上載者:User

<html>
<head>
   <script   language=javascript>
      //關閉前觸發的事件
     window.onbeforeunload =function()
       {  
    if(confirm("你確定要關閉嗎?")==true)
    {
       
    }else
    {
       return "關閉需謹慎!";
    }
              
    }
    //瀏覽器關閉後觸發的事件
    function onClosed()
    {
       alert("關閉後觸發的事件!");
    }
   
 </script>
</head>
<body  onUnload="onClosed();">
<object id=min classid="clsid:ADB880A6-D8FF-11CF-9377-00AA003B7A11"><param name="Command" value="Minimize"></object>

<object id=max classid="clsid:ADB880A6-D8FF-11CF-9377-00AA003B7A11"><param name="Command" value="Maximize"></object>

<object id=close classid="clsid:adb880a6-d8ff-11cf-9377-00aa003b7a11"><PARAM NAME="Command" value="Close"></object> 

<input type=button value=最小化 onclick=min.Click()> 
<input type=button value=最大化 onclick=max.Click()> 
<input type=button value=關閉 onclick=close.Click()></div>
<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 onclick=history.go(-1) type=submit value=後退>
<INPUT onclick=history.go(1) type=submit 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,');>
</body></html>

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.