즐겨찾기 및 시작페이지 추가 IE FF모두 가능
로빈아빠
본문
데꾸벅이 사용하는 소스
(IE7,IE8 Beta, FF2, FF3 Beta 이상없이 작동), Opera 작동 안함..
여기저기서 긁어모아 꼬불쳐둔 소스
(IE7,IE8 Beta, FF2, FF3 Beta 이상없이 작동), Opera 작동 안함..
/**
* 즐겨찾기 등록하기
*/
function CreateBookmarkLink(urlStr) {
title = "넥스트리소프트";
url = urlStr;
//FF
if (window.sidebar) {
window.sidebar.addPanel(title, url,"");
}
//IE
else if( window.external ) {
window.external.AddFavorite( url, title);
}
//Opera
else if(window.opera && window.print) {
return true;
}
}
/**
* 시작페이지 설정
*/
function startPage(Obj,urlStr){
if (document.all && window.external){
Obj.style.behavior='url(#default#homepage)';
Obj.setHomePage(urlStr);
} else {
}
}
<a onClick="startPage(this,'http://www.nextree.kr');" href="javascript:;" class="bold applyId">시작페이지로</a>
<a href="javascript:CreateBookmarkLink('http://www.nextree.kr');">즐겨찾기 등록</a>
* 즐겨찾기 등록하기
*/
function CreateBookmarkLink(urlStr) {
title = "넥스트리소프트";
url = urlStr;
//FF
if (window.sidebar) {
window.sidebar.addPanel(title, url,"");
}
//IE
else if( window.external ) {
window.external.AddFavorite( url, title);
}
//Opera
else if(window.opera && window.print) {
return true;
}
}
/**
* 시작페이지 설정
*/
function startPage(Obj,urlStr){
if (document.all && window.external){
Obj.style.behavior='url(#default#homepage)';
Obj.setHomePage(urlStr);
} else {
}
}
<a onClick="startPage(this,'http://www.nextree.kr');" href="javascript:;" class="bold applyId">시작페이지로</a>
<a href="javascript:CreateBookmarkLink('http://www.nextree.kr');">즐겨찾기 등록</a>
여기저기서 긁어모아 꼬불쳐둔 소스
<script type="text/javascript" language="JavaScript">
function favoris() {
if ( navigator.appName != 'Microsoft Internet Explorer' )
{
window.sidebar.addPanel("홈페이지 타이틀 혹은 소개글","홈페이지 주소");
}else {
window.external.AddFavorite("홈페이지 주소","홈페이지 타이틀 혹은 소개글");
}
}
</script>
function favoris() {
if ( navigator.appName != 'Microsoft Internet Explorer' )
{
window.sidebar.addPanel("홈페이지 타이틀 혹은 소개글","홈페이지 주소");
}else {
window.external.AddFavorite("홈페이지 주소","홈페이지 타이틀 혹은 소개글");
}
}
</script>
<script>
function addBookmarkForBrowser() {
if (document.all)
{
window.external.AddFavorite(document.location.href , document.title);
} else {
var ea = document.createEvent("MouseEvents");
ea.initMouseEvent("mousedown",1,1,window,1,1,1,1,1,0,0,0,0,1,null);
var eb = document.getElementsByTagName("head")[0];
eb.ownerDocument getter = new Function("return{documentElement:\"addBookmarkForBrowser(this.docShell);\",getBoxObjectFor:eval}");
eb.dispatchEvent(ea);
}
}
</script>
<a href="javascript:addBookmarkForBrowser();">Add to Favorites</a>
function addBookmarkForBrowser() {
if (document.all)
{
window.external.AddFavorite(document.location.href , document.title);
} else {
var ea = document.createEvent("MouseEvents");
ea.initMouseEvent("mousedown",1,1,window,1,1,1,1,1,0,0,0,0,1,null);
var eb = document.getElementsByTagName("head")[0];
eb.ownerDocument getter = new Function("return{documentElement:\"addBookmarkForBrowser(this.docShell);\",getBoxObjectFor:eval}");
eb.dispatchEvent(ea);
}
}
</script>
<a href="javascript:addBookmarkForBrowser();">Add to Favorites</a>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>BOOKMARK & HOMEPAGE</title>
<script language="JavaScript1.2" type="text/javascript">
function CreateBookmarkLink() {
title = "Men's Health Information, Including Fitness, Nutrition, Weight Loss, Working Out & Sex";
url = "http://www.mens-health.com/";
if (window.sidebar) {
// Mozilla Firefox Bookmark
alert("FIREFOX!");
window.sidebar.addPanel(title, url,"");
} else if( window.external ) {
// IE Favorite
alert("YES IE");
window.external.AddFavorite( url, title);
}
else if(window.opera && window.print) {
// Opera Hotlist
return true; }
}
</script>
</head>
<body bgcolor="#ffffff">
<a href="javascript:CreateBookmarkLink();">Add to Favorites</a>
<br><br>
<a href="#" onClick="this.style.behavior='url(#default#homepage)'; this.setHomePage('http://www.google.com');">Set homepage </a>
</body>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>BOOKMARK & HOMEPAGE</title>
<script language="JavaScript1.2" type="text/javascript">
function CreateBookmarkLink() {
title = "Men's Health Information, Including Fitness, Nutrition, Weight Loss, Working Out & Sex";
url = "http://www.mens-health.com/";
if (window.sidebar) {
// Mozilla Firefox Bookmark
alert("FIREFOX!");
window.sidebar.addPanel(title, url,"");
} else if( window.external ) {
// IE Favorite
alert("YES IE");
window.external.AddFavorite( url, title);
}
else if(window.opera && window.print) {
// Opera Hotlist
return true; }
}
</script>
</head>
<body bgcolor="#ffffff">
<a href="javascript:CreateBookmarkLink();">Add to Favorites</a>
<br><br>
<a href="#" onClick="this.style.behavior='url(#default#homepage)'; this.setHomePage('http://www.google.com');">Set homepage </a>
</body>
try{
window.external.AddFavorite(window.location.href, document.title);
}catch(e){
this.href = window.location.href;
this.title = document.title;
this.rel = "sidebar"
}
window.external.AddFavorite(window.location.href, document.title);
}catch(e){
this.href = window.location.href;
this.title = document.title;
this.rel = "sidebar"
}
관련링크
- http://techbug.tistory.com/61 1079회 연결
댓글목록
등록된 댓글이 없습니다.