zoukankan      html  css  js  c++  java
  • 加入收藏夹功能(jQuery)

    //设为首页

    function SetHomePage() {
        if (document.all) {
            document.body.style.behavior = 'url(#default#homepage)';
            document.body.setHomePage('http://www.87cool.com');
        }
        else if (window.sidebar) {
            if (window.netscape) {
                try {
                    netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
                }
                catch (e) {
                    alert("该操作被浏览器拒绝,如果想启用该功能,请在地址栏内输入 about:config,然后将项 signed.applets.codebase_principal_support 值该为true");
                }
            }
            var prefs = Components.classes['@mozilla.org/preferences-service;1'].getService(Components.interfaces.nsIPrefBranch);
            prefs.setCharPref('browser.startup.homepage', 'http://www.87cool.com');
        }
    }

    //加入收藏夹
    function AddFavorite() {
        var title = document.title;
        var url = location.href;
        if (window.sidebar) {
            window.sidebar.addPanel(title, url, "");
        } else if (document.all) {
            window.external.AddFavorite(url, title);
        } else {
            return true;
        }
    }

  • 相关阅读:
    MySQL 查询各科前三的数据
    MySQL 分时间段查询
    MySQL 查询同一字段中同时满足多个条件
    MySQL 分组累加
    快速搭建LNMP
    打开页面默认弹出软键盘,同时兼容iOS和Android
    linux 系统的ssh服务
    linux 磁盘
    linux系统基础网络配置
    discuz中方法
  • 原文地址:https://www.cnblogs.com/liaojunbo/p/1435374.html
Copyright © 2011-2022 走看看