0
I’m doing an integration with a social plugin and I’m having a problem.
My code:
linkedin : function(self){
var sett = self.options.buttons.linkedin;
$(self.element).find('.buttons').append('<div class="button linkedin"><script type="IN/Share" data-url="'+(sett.url !== '' ? sett.url : self.options.url)+'" data-counter="'+sett.counter+'"></script></div>');
var loading = 0;
if(typeof window.IN === 'undefined' && loading == 0){
loading = 1;
(function() {
var li = document.createElement('script');li.type = 'text/javascript';li.async = true;
li.src = '//platform.linkedin.com/in.js';
var s = document.getElementsByTagName('script')[0];s.parentNode.insertBefore(li, s);
})();
}
else{
window.IN.init();
}
},
The code above is responsible for creating something like:
<script src="//platform.linkedin.com/in.js" type="text/javascript"></script>
<script type="IN/Share" data-counter="top"></script>
But I need it to create equal above though, adding lang: pt-BR
before the </script>
in the script pulled from Linkedin.
Thus:
<script src="//platform.linkedin.com/in.js" type="text/javascript">
lang: pt_BR
</script>
<script type="IN/Share" data-counter="top"></script>
Would such an adaptation be possible? How?
Perfect! My widget :D is now in English
– Alexandre Lopes
Okay @ramaral, thanks for the feedback.
– bfavaretto