function bookmarkPage(url,title) {
if (!url) {url = window.location}
if (!title) {title = document.title}
var browser=navigator.userAgent.toLowerCase();
if (window.sidebar) { // Mozilla, Firefox, Netscape
window.sidebar.addPanel(title, url,"");
} else if( window.external) { // IE or chrome
if (browser.indexOf('chrome')==-1){ // ie
window.external.AddFavorite( url, title); 
} else { // chrome
alert('Please Press CTRL+D (or Command+D for macs) to bookmark this page');
}
}
else if(window.opera && window.print) { // Opera - automatically adds to sidebar if rel=sidebar in the tag
return true;
}
else if (browser.indexOf('konqueror')!=-1) { // Konqueror
alert('Please press CTRL+B to bookmark this page.');
}
else if (browser.indexOf('webkit')!=-1){ // safari
alert('Please press CTRL+B (or Command+D for macs) to bookmark this page.');
} else {
alert('Your browser cannot add bookmarks using this link. Please add this link manually.')
}
}

'script' 카테고리의 다른 글

스크린 사이즈  (0) 2012.02.17
툴팁 하단 텍스트  (0) 2012.02.17
페이지내 이동3  (0) 2012.02.17
퀵메뉴 - 스크롤 따라다니는 레이어  (0) 2012.02.17
스크롤바 이미지  (0) 2012.02.17

+ Recent posts