Button to share on Likedin

Asked

Viewed 35 times

0

I’m trying to share news from my site on Likedin, only I’m not able to share.

I tried to follow this topic Create share button on Linkedin only it didn’t work for me.

My code:

<a href="#" onclick="linkedin(event, '<?= Site ?>/noticias/?noticia=2', '<?= $noticia->title ?>');return false;">
    <button type="button" class="btn info";"><i class="fab fa-linkedin-in"></i></button>
</a>

linkedin = function (event, s, a){
    event.preventDefault();
    window.open('https://www.linkedin.com/cws/share?url=' +s+ '?name=' +a, 'newwindow', 'width=680, height=450');
};

He’s not sending the id from news to sharing.

  • Would not be <?=$Site ?>?

  • It’s just a system variable

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.