Thứ Sáu, 6 tháng 11, 2009

Add Favarite Bookmark Javascritp

function CreateBookmarkLink() {

title = "Webpage Title";
// Blogger - Replace with <$BlogItemTitle$>
// MovableType - Replace with <$MTEntryTitle$>

url = "Webpage URL";
// Blogger - Replace with <$BlogItemPermalinkURL$>
// MovableType - Replace with <$MTEntryPermalink$>
// WordPress -

if (window.sidebar) { // Mozilla Firefox Bookmark
window.sidebar.addPanel(title, url,"");
} else if( window.external ) { // IE Favorite
window.external.AddFavorite( url, title); }
else if(window.opera && window.print) { // Opera Hotlist
return true; }
}

if (window.external) {
document.write(' \"javascript:CreateBookmarkLink()\");">Add to Favorites');
} else if (window.sidebar) {
document.write(' \"javascript:CreateBookmarkLink()\");">Bookmark Page');
} else if (window.opera && window.print) {
document.write(' \"javascript:CreateBookmarkLink()\");">Add Bookmark');
}

Không có nhận xét nào: