从网站分享时,在推文中添加图片 [英] Add image in tweet while sharing from website

查看:188
本文介绍了从网站分享时,在推文中添加图片的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,



我已经创建了twitter按钮并添加了以下代码来实现它。它的工作正常。

现在我想要一张带有这条推文的图片。任何人都知道,如何在推文中添加图片?

如果有人这样做,请告诉我。





< script> 
$( #aTwitter)。click( function (){
var url = encodeURIComponent( @ TempData [ AppUrl ] \ n#hashlink);
var text = encodeURIComponent( 我喜欢@TempData [ AppName ]!\ n今天下载: );
window .open( https://twitter.com/home?status= + text + url,
' twitter-tweet-dialog'' 宽度= 626,高度= 436' );
return false ;
});

< / script>





我的尝试:



我试图在我的网站上创建推文按钮并已正确完成但无法在同一条推文中添加图片。你的小帮助将节省我的时间...... ..

解决方案

#aTwitter)。click( function (){
var url = encodeURIComponent( @ TempData [ AppUrl ] \ n#hashlink);
var text = encodeURIComponent( 我很喜欢@TempData [ AppName ]!\ n今天下载:);
window .open( https://twitter.com/home ?status = + text + url,
' twitter-tweet-dialog'' width = 626,height = 436');
return false ;
});

< / script>





我的尝试:



我试图在我的网站上创建推文按钮并已正确完成但无法在同一条推文中添加图片。你的小帮助将节省我的时间...... ..


Hi Everyone,

I have created twitter button and added below code to work it. Its working fine.
Now I want to an image with this tweet. Any one knows, How to add image in tweet?
Please tell me if any one have done this.


<script>
    $("#aTwitter").click(function () {
        var url = encodeURIComponent("@TempData["AppUrl"]\n#hashlink");
        var text = encodeURIComponent("I am loving the @TempData["AppName"] !\n Download it today: ");
        window.open("https://twitter.com/home?status=" + text + url,
            'twitter-tweet-dialog','width=626,height=436');
        return false;
    });

</script>



What I have tried:

I have tried to create tweet button on my website and have done it properly but not able to add image in the same tweet.Your little help will save my time .....

解决方案

("#aTwitter").click(function () { var url = encodeURIComponent("@TempData["AppUrl"]\n#hashlink"); var text = encodeURIComponent("I am loving the @TempData["AppName"] !\n Download it today: "); window.open("https://twitter.com/home?status=" + text + url, 'twitter-tweet-dialog','width=626,height=436'); return false; }); </script>



What I have tried:

I have tried to create tweet button on my website and have done it properly but not able to add image in the same tweet.Your little help will save my time .....


这篇关于从网站分享时,在推文中添加图片的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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