2020년도 이전/[WebSig] JavaScript
모든 브라우저 대응하는 자바스크립트 즐겨찾기
시그시끄
2013. 6. 22. 13:43
//즐겨찾기
function addbookmark() {
var url = "http://www.fs1025.mireene.com"; // URL
var title = "I love Dokdo"; // 사이트 이름
var browser=navigator.userAgent.toLowerCase();
// Mozilla, Firefox, Netscape
if (window.sidebar) {
window.sidebar.addPanel(title, url,"");
}
// IE or chrome
else if( window.external) {
// IE
if (browser.indexOf('chrome')==-1){
window.external.AddFavorite( url, title);
} else {
// chrome
alert('CTRL+D');
}
}
// Opera - automatically adds to sidebar if rel=sidebar in the tag
else if(window.opera && window.print) {
return true;
}
// Konqueror
else if (browser.indexOf('konqueror')!=-1) {
alert('CTRL+B');
}
// safari
else if (browser.indexOf('webkit')!=-1){
alert('CTRL+D');
} else {
alert('With this button, you will not be able to add your favorites.')
}
}
function addbookmark() {
var url = "http://www.fs1025.mireene.com"; // URL
var title = "I love Dokdo"; // 사이트 이름
var browser=navigator.userAgent.toLowerCase();
// Mozilla, Firefox, Netscape
if (window.sidebar) {
window.sidebar.addPanel(title, url,"");
}
// IE or chrome
else if( window.external) {
// IE
if (browser.indexOf('chrome')==-1){
window.external.AddFavorite( url, title);
} else {
// chrome
alert('CTRL+D');
}
}
// Opera - automatically adds to sidebar if rel=sidebar in the tag
else if(window.opera && window.print) {
return true;
}
// Konqueror
else if (browser.indexOf('konqueror')!=-1) {
alert('CTRL+B');
}
// safari
else if (browser.indexOf('webkit')!=-1){
alert('CTRL+D');
} else {
alert('With this button, you will not be able to add your favorites.')
}
}