添加收藏夹(兼容部分)

<script type="text/javascript">
        function addFav() {   // 加入收藏夹 
            if (document.all) {
                window.external.addFavorite('http://www.cnblogs.com/wuchao/’, 'wuchaode blog');
            }
            else if (window.sidebar) {
                window.sidebar.addPanel('wuchaode blog', 'http://www.cnblogs.com/wuchao/’, "");
            }
        }
        function SetHome(obj) {
            try {
                obj.style.behavior = 'url(#default#homepage)';
                obj.setHomePage('网站地址');
            } catch (e) {
                if (window.netscape) {
                    try {
                        netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
                    } catch (e) {
                        alert(" 抱歉,此操作被浏览器拒绝!\n\n请在浏览器地址栏输入“about:config”并回车然后将 [signed.applets.codebase_principal_support]设置为'true'");
                    };
                } else {
                    alert(" 抱歉,您所使用的浏览器无法完成此操作。\n\n您需要手动将'http://www.cnblogs.com/wuchao/设置为首页。");
                };
            };
        }; 
         </script>

posted @ 2012-10-11 16:42  Uoolo  阅读(216)  评论(0编辑  收藏  举报