1
我想通过Twitter/Facebook共享按钮从我的网站共享referral url
。我有自定义的分享按钮。
我可以在这两个网站上共享引荐网址,但由于target=_blank
,Facebook的共享链接和Twitter的Tweet页面出现在新标签上。
然后我想要在iFrame
以便用户在共享引荐链接时不会离开我的网站。Facebook和Twitter通过iframe共享
Facebook共享代码
<a title="send to Facebook"
href="http://www.facebook.com/sharer.php?s=100&p[title]=YOUR_TITLE&p[summary]=YOUR_SUMMARY&p[url]=YOUR_URL&p[images][0]=YOUR_IMAGE_TO_SHARE_OBJECT"
target="_blank">
<span>
Twitter共享代码
<a href="#" id="shareWithTwitter" onclick="shareWithTwitter()">
<img class="social-share" src="<?php echo site_url('img/twitter.png'); ?>"/>
</a>
function shareWithTwitter()
{
var url = 'https://twitter.com/home?status=Join Fashion on '+$('#referal-URL').val();
$('#shareWithTwitter').attr('href',url);
}