How do I append a page's URL to a social media 'sharing' URL in jQuery?
<p>How do I create a link that takes the static part of a 'sharing' link (of a social media site like LinkedIn) and appends the url of the current page? So that a user can share the page's URL on their social media account.</p>

<p>I do not want to use Share This or any other such widgets.</p>

<p>Thanks</p>

<p><strong>EDIT</strong></p>

<p>So of the solutions suggested I opted for the jQuery one. After a lot of help, this was the solution:</p>

<p>HTML</p>

<pre><code>&lt;a class="linkedin" href="#"&gt;LinkedIn&lt;/a&gt;
</code></pre>

<p>jQuery</p>

<pre><code>$(document).ready(function() { 
  $('a.linkedin').click(function() {
    var link = document.location;
    var url = "https://www.linkedin.com/shareArticle?mini=true&amp;url=" + link;
    document.location.href = url;
  });
});
</code></pre>

<p>Obviously, it can work for any social media site that allows such URLs.</p>
