Skip to content

Instantly share code, notes, and snippets.

@CooLNuanfeng
Created July 23, 2014 06:08
Show Gist options
  • Save CooLNuanfeng/f1066dc2534f025a00c5 to your computer and use it in GitHub Desktop.
Save CooLNuanfeng/f1066dc2534f025a00c5 to your computer and use it in GitHub Desktop.
微博分享
var imgName = '1.jpg'; //开发,传入生成后的图片名称。
var title = '分享文字'; //定义分享文字内容,等待
var url = 'http://www.lvmama.com/zt/promo/ztname/'; //要分享的页面链接
var img = url+'imgnew/'+imgName; //分享的图片路径
var fxHref = 'http://service.weibo.com/share/share.php?title='+ title +'&url='+ url +'&source=bookmark&appkey=2992571369&pic='+ img +'&ralateUid=&sudaref=s.jiathis.com';
window.open(fxHref);
//window.location.href=fxHref
//js 分享选中文字方法
//选择文字
function selectText(){
if(document.selection){ //IE
return document.selection.createRange().text;
}else{ //标准
return window.getSelection().toString();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment