javascript - Twitter 共享链接在移动设备上不起作用,但在桌面设备上可用

标签 javascript mobile twitter

问题

我一直在对链接进行硬编码,以便在 Twitter 上分享一条预先制作的推文 - 无论是在 block 引用中还是在一般网站中,都可以在 http://bdnsun.ca/veteransdoc 中找到>。推文链接可以在桌面上使用,但当我尝试在 iPhone 上分享相同的链接时,它会将我带到移动 Twitter 网站,但没有预先发布的推文。有解决办法吗?

实时链接:http://bdnsun.ca/veteransdoc

index.html

包含硬编码推文的示例,在本例中应为“所有街道都被封锁了……我们知道我们会被俘虏,”Elmer Cole,PoW 幸存者:http://bdnsun.ca/退伍军人文档

<!-- Blockquote -->
                        <blockquote>
                            <p class="quote__text">“All the streets were blocked off and they wouldn’t evacuate us because we had to stay and keep the Germans off the beach. So we knew we was gonna get taken prisoner.” </p>

                            <div class="quote__person">
                                <p class="quote__name">Elmer Cole</p>
                                <p class="quote__title">South Saskatchewan Regiment</p>
                            </div>

                            <div class="quote__icon">
                                <a href="https://twitter.com/home?status=%E2%80%9CAll%20the%20streets%20were%20blocked%20off%20%E2%80%A6%20we%20knew%20we%20was%20gonna%20get%20taken%20prisoner,%E2%80%9D%20Elmer%20Cole,%20PoW%20survivor%3A%20http%3A//bdnsun.ca/veteransdoc" target="_blank" class="link--twitter"title="Share on Twitter"><span class="tooltip-toggle" data-tooltip="Tweet this quote"><i class="icon-twitter fa fa-twitter" aria-hidden="true"></i></span></a>
                            </div>
                        </blockquote>

最佳答案

Twitter 已经有一段时间了 updated its share link 。现在有单独的 texturl 参数:

https://twitter.com/intent/tweet?text=text+to+share&url=https://example.org

专业提示:您还可以提供以逗号分隔的标签!

https://twitter.com/intent/tweet?hashtags=one,two,three&text=&url=

关于javascript - Twitter 共享链接在移动设备上不起作用,但在桌面设备上可用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37665586/

相关文章:

php - Twitter POST direct_messages/新 api 不工作

jquery - 在没有 anchor 标记的情况下使用 (this)

css - 试图在移动设备上隐藏图像

javascript - Node.js 中用于获取推文总数的 Do/while 循环仅运行一次

javascript - jQuery datepicker 没有正确更新值

javascript - React FormIk 将值重置为空值 handleReset 函数

javascript - javascript 的求值顺序

javascript - 内容感知在运行时调整图像大小

css - 具有相同 css 文件的不同屏幕方向

html - Ruby on Rails - 显示来自 twitter feed 的最后 x 条推文