分享到新浪微博---js

<script type="text/javascript" charset="utf-8">
(function(){
  var _w = 106 , _h = 20;
  var param = {
    url:location.href,
    type:'6',/*显示新浪图标1-6(可选)*/
    count:'', /**是否显示分享数,1显示(可选)*/
    appkey:'4026630105', /**您申请的应用appkey,显示分享来源(可选)*/
    title:' 分享框里的内容   ',
    pic:' 分享的图片  ',
    ralateUid:' 用户Id  ', /**关联用户的UID,分享微博会@该用户(可选)*/
    rnd:new Date().valueOf()
  }
  var temp = [];
  for( var p in param ){
    temp.push(p + '=' + encodeURIComponent( param[p] || '' ) )
  }
  document.write('<iframe allowTransparency="true" frameborder="0" scrolling="no" src="http://hits.sinajs.cn/A1/weiboshare.html?' + temp.join('&') + '" width="'+ _w+'" height="'+_h+'"></iframe>')
})()
</script>

 

 

原文:

 

<script type="text/javascript" charset="utf-8">
(function(){
  var _w = 106 , _h = 20;
  var param = {
    url:location.href,
    type:'6',
    count:'', /**是否显示分享数,1显示(可选)*/
    appkey:'4026630105', /**您申请的应用appkey,显示分享来源(可选)*/
    title:'资深人士质疑央视专家观点 到底谁是鳕鱼界的“李鬼”',
    pic:'http://www.zgsc123.com/zt/xueyu/images/shijian.jpg',
    ralateUid:'2418311993', /**关联用户的UID,分享微博会@该用户(可选)*/
    rnd:new Date().valueOf()
  }
  var temp = [];
  for( var p in param ){
    temp.push(p + '=' + encodeURIComponent( param[p] || '' ) )
  }
  document.write('<iframe allowTransparency="true" frameborder="0" scrolling="no" src="http://hits.sinajs.cn/A1/weiboshare.html?' + temp.join('&') + '" width="'+ _w+'" height="'+_h+'"></iframe>')
})()
</script>

posted @ 2012-08-29 13:41  momoの前端花园  阅读(1141)  评论(0编辑  收藏  举报