admin管理员组文章数量:1334329
I'm trying to implement a Facebook share button in my Next.js application with a pre-filled Arabic hashtag, but I'm running into an issue.
Here is the code I'm using:
const handleShare = (e) => {
e.preventDefault();
if (score) {
const shareParams = new URLSearchParams({
u: shareUrl,
hashtag: "#هاشتاگێکی_دیاریکراو",
}).toString();
const fbShareUrl = `.php?${shareParams}`;
// Open share dialog
window.open(
fbShareUrl,
"_blank",
"width=600,height=400,left=" +
(window.innerWidth - 600) / 2 +
",top=" +
(window.innerHeight - 400) / 2
);
}
};
The issue is that when I click the hashtag in Facebook after sharing the post, the URL of the hashtag changes. For example, this is what I get:
The added ?__eep__=6
parameter breaks the hashtag. If I manually remove ?eep=6 from the URL in the browser, the hashtag works correctly.
I have tried these approaches:
- Encoding the hashtag
(encodeURIComponent("#هاشتاگێکی_دیاریکراو"))
- Removing the
#
sign
Still none of these works.
本文标签: javascriptArabic Hashtag in Facebook Sharer Adds Unwanted Characters (egeep6)Stack Overflow
版权声明:本文标题:javascript - Arabic Hashtag in Facebook Sharer Adds Unwanted Characters (e.g., ?__eep__=6) - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742354843a2459201.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论