Issue on IE with LinkedIn Share plugin

戏子无情 提交于 2021-02-04 08:05:24

问题


I am working for my client and there we have used LinkedIn share plugin (https://developer.linkedin.com/plugins/share) but we have been facing an issue with this plugin while using MS Internet Explorer. When the user clicks on the LinkedIn share plugin on IE, another popup window opens, this popup works fine over other browsers like Firefox, Chrome however on IE (with most users on IE11 and IE Edge), it shows an alert saying: "The webpage you are viewing is trying to close the window." If user clicks on "No" then it redirects to LinkedIn 404/Page not found (https://www.linkedin.com/404). We are looking for your help to investigate the issue to find the root cause and get it addressed.

Any help in fixing this issue will be greatly appreciated.


回答1:


The issue is that you're relying on the SDK and the plugin JS library for making and generating the button. That means all of LinkedIn's JS libs could be do any number of things to make the button appear and behave as it does. To have a URL-sharing link to Linkedin, all you really ought to need is...

https://www.linkedin.com/sharing/share-offsite/?url={url}

Then you can just make any button, using any HTML, CSS, or JavaScript that you like, and hyperlink it to allow sharing of a page. Like so...

<a href="https://www.linkedin.com/sharing/share-offsite/?url={url}" target="_blank">Share on LinkedIn</a>

Source: Microsoft LinkedIn Share URL Documentation.

If you are interested in a regularly maintained github project that keeps track of this so you don't have to, check it out! Social Share URLs



来源:https://stackoverflow.com/questions/49093691/issue-on-ie-with-linkedin-share-plugin

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!