【问题标题】:Can't share URL on twitter with a query string无法使用查询字符串在 Twitter 上共享 URL
【发布时间】:2013-11-04 01:50:13
【问题描述】:

我正在尝试使用查询字符串发送 URL,但它无法正常工作。 URL 的格式如下:http://domain.com/videos/watch?v=123

我的代码在下面

<a class="tw" href="https://twitter.com/intent/tweet?status=<?= urlencode($video[0]['tweet_text']) . 'http://domain.com/videos/watch?v=' $video[0]['_pw']['id'] ?>">Tweet</a>

当我删除 v= 之后的数字时,会显示推文对话框。当我保留 ?v=123 时,推文对话框只会加载 twitter.com。

【问题讨论】:

    标签: html twitter hyperlink share social


    【解决方案1】:

    尝试对文本和网址进行编码

    <a class="tw" href="https://twitter.com/intent/tweet?status=<?= urlencode($video[0]['tweet_text'] . 'http://domain.com/videos/watch?v=' $video[0]['_pw']['id']) ?>">Tweet</a>
    

    【讨论】:

      猜你喜欢
      • 2011-09-06
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2022-07-17
      • 2019-07-29
      • 2018-10-07
      • 1970-01-01
      • 2013-10-06
      相关资源
      最近更新 更多