• 分享 朋友圈 微博 QQ空间


    <!DOCTYPE html>
    <html lang="en">
    <head>
        <meta charset="UTF-8">
        <title>分享</title>
    </head>
    <body>
        <div class="share_top_style">
            <a href="javascript:void()" class="" onClick="dofristshare('sina')"><img src="images/sina.png" alt="新浪微博"></a>
    
            <a href="javascript:void()" class="" onClick="dofristshare('tx')"><img src="images/tx.png" alt="腾讯微博"></a>
    
            <a href="javascript:void()" class="" onClick="dofristshare('rr')"><img src="images/rr.png" alt="人人网"></a>
    
            <a href="javascript:void()" class="" onClick="dofristshare('qzone')"><img src="images/qq.png" alt="QQ空间"></a>
    
            <a href="javascript:void()" class="" onClick="dofristshare('douban')"><img src="images/db.png" alt="豆瓣"></a>
     </div>
    </body>
    <script type="text/javascript">
        function dofristshare(type) {
        var title = encodeURIComponent("新年快乐,马年吉祥");  //encodeURIComponent() 函数可把字符串作为 URI 组件进行编码。
        var link = encodeURIComponent('http://www.baidu.com');
        var image = encodeURIComponent('http://www.baidu.com/img/bdlogo.gif');
    
        if (type == "sina") {
            window.open("http://v.t.sina.com.cn/share/share.php?url=" + link + "&title=" + title + "&content=utf8&pic=" + image);
        }
    
        if (type == "tx") {
            window.open("http://v.t.qq.com/share/share.php?url=" + link + "&title=" + title + "&pic=" + image);
        }
    
        if (type == "qzone") {
            window.open("http://sns.qzone.qq.com/cgi-bin/qzshare/cgi_qzshare_onekey?url=" + link + "&title=" + title  + "&pics=" + image);
        }
    
        if (type == "rr") {
            window.open("http://widget.renren.com/dialog/share?resourceUrl=" + link + "&title=" + title  + "&pic=" + image);
        }
    
       if (type == "douban") {
            window.open("http://www.douban.com/recommend/?url=" + link + "&title=" + title + "&image=" + image);
        }
    
        return false;
    
    }
    
    </script>
    </html>
  • 相关阅读:
    A*算法(八数码问题)
    【第一篇:C++与opencv】图片的读取和显示
    iOS事件拦截(实现触摸任意位置隐藏指定view)
    tableview随笔
    解决UITableView中Cell重用机制导致内容出错的方法总结
    iOS 数据类型转换
    git Xcode
    ios 读取各种类型文件
    iOS学习之iOS沙盒(sandbox)机制和文件操作之NSFileManager(三)
    iOS学习之NSBundle介绍和使用
  • 原文地址:https://www.cnblogs.com/jinsuo/p/7840560.html
Copyright © 2020-2023  润新知