web開發,IE9的一個很重要的更新就是可以把一個網站拉到任務欄里,把一個網站當作一個web應用程序。同時一個網站也可以在開始菜單欄里面,當作一個應用程序,但應用程序需要網絡的支持。
web開發里面,數據庫的內容我們可以不改,但我們可以按我們的意愿去改動一個web應用程序外觀等內容。頁面里面的內容,我們不需要改動,當然也可以改動。
1,我們可以改動頭元素(meta)
添加代碼
<meta name="application-name" content="Pinned Name"/>
<meta name="msapplication-tooltip" content="Start Site"/>
<meta name="msapplication-starurl" content="http://host/page.htm"/>
<meta name="msapplication-window" content="width=1024;height=768"/>
<meta name="msapplication-navbutton-color" content="#ff3300"/>
這些可以改變應用程序的外觀。
2,自定義圖標
使用站點的收藏圖標
<link rel="sortcut icon" herf="/favicon.ico"/>
3,添加圖標覆蓋
給用戶提供通知或處理進度
window.exernal.msSiteModeSetIconOverlay('http://host/star.ico','complete');
window.external.msSiteModeClearIconOverlay();
4,固定網站進行編程
if(window.external.msIsSiteMode())
{//we are already in site mode}
else{
//Show HTML elements that will promote the
//addition of a pin ste tothe Progrms menu
window.external.msAddSiteMode()}
5,添加任務跳轉列表
與windows 7無縫集成
<meta name="msapplication-task" content="name=New Message;
action-uri=http://host/NewMail.htm;
icon-uri=http://host/mail.ico"/>
<meta name="msapplication-task" content="name=New Appointment;
action-uri=http://host2/NewAppt.htm;
icon-uri=http://host2/Appt.ico"/>
6,自定義跳轉列表
添加自定義跳轉列表類別
window.external.msSiteModeCreateJumplist('Notfication');
window.external.msSiteModeAddJumpListItem(
'Scrum(37minutes overdue)',
'http://host/reminders.html',
'http://host/image/bell.ico');
window.external.msSiteModeShowJumplist();
7,顯示縮略圖工具欄按鈕
var but1=window.eaternal.msSiteModeAddThumbBarButton(
'http://host/speaker.ico','Mute');
document.addEventListener(
'msthumbnailclick',handler,false);
window.external.msSiteModeShowThumbBat();
8,修改縮略圖工具欄按鈕
修改按鈕屬性
window.external.msSiteModeUpdateThumbBarButton(buttonID,Enableed,Visible);
修改按鈕樣式
var style1=window.external,msSiteModeAddButtonStyle(butttonID,IconUrl,ToolTip)
wndow.external,msSiteModeShowButtonStyle(buttonID,styleID);
新聞熱點
疑難解答