gpt4 book ai didi

javascript - 社交共享链接弹出窗口未在共享页面上显示正确的 URL

转载 作者:行者123 更新时间:2023-12-03 07:40:49 25 4
gpt4 key购买 nike

https://jsfiddle.net/6yrr82ph/

我正在尝试分享此链接http://www.domain.com/list.php?id=10&category=food

但在分享页面上我刚刚得到

http://www.domain.com/list.php?id=10 共享页面上的此链接。

我在获取第二个变量类别时遇到问题。

我不知道发生了什么问题。请修复此代码

<div class="list text-center" style="margin: 10px;">  

<a class="item" href="#" onclick="window.open('http://www.facebook.com/sharer.php?u=http://www.domain.com/list.php?id=10&category=food', '_system', 'location=yes'); return false;">
facebook share <i class="fa fa-facebook-square"></i> </a><br><br>
<a class="item" href="#" onclick="window.open('http://twitter.com/share?text=title of blog&url=http://www.domain.com/list.php?id=70&category=food', '_system', 'location=yes'); return false;"> <i class="fa fa-twitter-square"></i> twitter share
</a>


</div>

最佳答案

您需要使用urlencode对您的网址进行编码。

试试这个:

<a class="item" href="#" onclick="window.open('http://www.facebook.com/sharer.php?u=<?php echo urlencode("http://www.domain.com/list.php?id=10&category=food");?>', '_system', 'location=yes'); return false;">

关于javascript - 社交共享链接弹出窗口未在共享页面上显示正确的 URL,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35424158/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com