Facebook和Twitter分享移动网络 [英] Facebook and twitter share for mobile web

查看:121
本文介绍了Facebook和Twitter分享移动网络的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有用于共享到Facebook和Twitter移动版的特殊URL? 还是和网站上的一样?

Is there a special url for sharing to Facebook and Twitter for mobile? Or are they the same as those from websites?

使用

<script src="http://platform.twitter.com/widgets.js" type="text/javascript"></script>   
<a href="javascript:return false;" rel="nofollow" onclick="window.open('https://twitter.com/share?text=sometext&url=someurl', 'Twitter', 'toolbar=0,status=0,width=626,height=436')">Twitter</a>

对于Twitter和

<script>
    function fbs_click() 
    {
        u='www.something';
        t='title';
        window.open('http://www.facebook.com/sharer/sharer.php?u='+encodeURIComponent(u)+'&t='+encodeURIComponent(t),'sharer','toolbar=0,status=0,width=626,height=436');
        return false;
    }
</script>

<a rel="nofollow" href="http://www.facebook.com/sharer/sharer.php?u=someurl" onclick="return fbs_click()" target="_blank" class="">Facebook</a>

针对Facebook.

for Facebook.

推荐答案

您的共享实现应该相同,并且只要您的移动用户具有支持JavaScript或呈现JavaScript的设备,它们就可以正常工作.否则,您可以使用每个平台的API URL在链接内共享,唯一的问题是回调将它们重定向到Twitter或Facebook,并且它们必须手动返回到您的站点.链接如下:

Your sharing implementation should be the same and should work so long as your mobile users have devices capable or rendering JavaScript. Otherwise you can use each platforms' API url to share inside a link, the only problem is the callback redirects them either to Twitter or Facebook and they'll have to manually return to your site. The links are as below:

在Facebook上共享:

Sharing on Facebook:

http://m.facebook.com/sharer.php?u=<urlencoded url>t=<urlencoded title>

例如:

http://m.facebook.com/sharer.php?u=http://www.google.com

在Twitter上更新状态

Updating status on Twitter:

http://mobile.twitter.com/home?status=<urlencoded status>

这篇关于Facebook和Twitter分享移动网络的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆