Internet Explorerのお気に入り機能をWebページにテキストやボタンで埋め込みます。
基本
記述例 1)
head要素)
<meta http-equiv="content-script-type" content="text/javascript">
本文)
テキストボタン)
<a href="javascript:window.external.addFavorite('http://xxxxxxxxxxx.xxx.xxx.com/', 'サイト名')">お気に入りに追加</a>
プッシュボタン)
<input type="button" onclick="javascript:window.external.addFavorite('http://xxxxxxxxxxx.xxx.xxx.com/','サイト名')" value="お気に入りに追加">
※URLとサイト名を変更して下さい。ボタンのテキストはお好みで。
テキストボタンの文字色を変更
記述例)
スタイルシート)
color: #8fbc8f;
テキストボタン)
<a href="javascript:window.external.addFavorite('http://xxxxxxxxxxx.xxx.xxx.com/', 'サイト名')">お気に入りに追加</a>
RGB値/カラーネーム一覧(新規ウィンドウが開きます)
枠付きテキストボタン
記述例)
スタイルシート)
color: #ee82ee;
border: 1px solid #ee82ee;
padding: 3px;
text-decoration: none;
テキストボタン)
<a href="javascript:window.external.addFavorite('http://xxxxxxxxxxx.xxx.xxx.com/', 'サイト名')">お気に入りに追加</a>
RGB値/カラーネーム一覧(新規ウィンドウが開きます)
テキストボタンの背景色
記述例)
スタイルシート)
color: #ee82ee;
background-color: #ffe4e1;
padding: 3px;
text-decoration: none;
テキストボタン)
<a href="javascript:window.external.addFavorite('http://xxxxxxxxxxx.xxx.xxx.com/', 'サイト名')">お気に入りに追加</a>
RGB値/カラーネーム一覧(新規ウィンドウが開きます)