simple js

 

function copyToClipBoard()   
{ var clipBoardContent=document.location.href;clipBoardContent+='\r\n' +    
document.title;window.clipboardData.setData("Text",clipBoardContent);   
alert("网址复制成功,快粘贴给你的好友吧:\r\n" + clipBoardContent);}  

 

     收藏website

   

 

//添加首页和收藏网站的
<script>
var HomepageFavorite = {
    //设为首页
     function () {
        if (document.all) {
            document.body.style.behavior = 'url(#default#homepage)';
            document.body.setHomePage(window.location.href);

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

    //加入收藏
     function Favorite(sURL, sTitle) {
        try {
            window.external.addFavorite(sURL, sTitle);
        }
        catch (e) {
            try {
                window.sidebar.addPanel(sTitle, sURL, "");
            }
            catch (e) {
                alert("加入收藏失败,请手动添加.");
            }
        }
    }
}
</script>
    支持火狐,IE6.ie7.ie8.ie9的加入收藏/设为首页代码
    <a href="javascript:HomepageFavorite.Homepage()" _fcksavedurl="javascript:HomepageFavorite.Homepage()" >设为首页</a>
    <a href="javascript:HomepageFavorite.Favorite(window.location.href, document.title)" _fcksavedurl="javascript:HomepageFavorite.Favorite(window.location.href, document.title)" >加入收藏</a>
      发送邮件的js脚本:<a href="mailto:dream1989.happy@163.com">发送邮件</a>

你可能感兴趣的:(JavaScript,Google,脚本,百度)