LinkedIn share button
Ticket on Forge:
Author: DANIEL Rémy
Description:
Hi
I had an issue with the share button proposed by linkedIn (https://developer.linkedin.com/plugins/share). In order to add this button to a page, here is the code to place on the page:
<script src="//platform.linkedin.com/in.js" type="text/javascript"> lang: fr_FR</script>
<script type="IN/Share"></script>
The first script tag will include their library, with a configuration directly passed in the body of the tag. The second script tag is a placeholder which will be replaced by the share button.
With scriptmerger activated, the first script tag will get merged with other js resources, and the second script tag will get merged with "inDocument" script tags.
We need to exclude both script tags from being merged :
- the first because it contains some configuration in its body
- the second because it is a placeholder that need to stay at is place But, scriptmerger does not allow to exclude "inDocument" tags...
Here is the hack that I used:
<script src="//platform.linkedin.com/in.js" type="text/javascript" data-ignore="1"> lang: fr_FR</script>
<script src="about:blank" type="IN/Share" data-ignore="1"></script>
Like that, the second script tag is not considered "inDocument" by scriptmerger, and "data-ignored" works.
It will be a nice feature if we can use also data-ignore="1" for "inDocument" script tags.