Add a DotNetKicks button to your Webpage

DotNetKicks is a popular .NET community based news site. A lot of users use the DotNetKicks social bookmarking button which makes it easier for viewers to submit or ‘kick’ a story. If you have been wondering how to add the DotNetKicks button to every post on your website, here’s the code for it.

<div>
<script type="text/javascript">
document.write('<a href="http://www.dotnetkicks.com/submit?url='+document.location.href+'&amp;title='+document.title+'"> <img src="http://www.dotnetkicks.com/Services/Images/KickItImageGenerator.ashx?url='+document.location.href+'" border="0"></a>');
</script>
</div>

This piece of code determines the URL using ‘document.location.href’ and the Title using ‘document.title’. This information is submitted to the dotnetkicks site when the user click on the link/image. When this code is placed on a page, the output generated is as shown below:

image






About The Author

Suprotim Agarwal
Suprotim Agarwal, Developer Technologies MVP (Microsoft Most Valuable Professional) is the founder and contributor for DevCurry, DotNetCurry and SQLServerCurry. He is the Chief Editor of a Developer Magazine called DNC Magazine. He has also authored two Books - 51 Recipes using jQuery with ASP.NET Controls. and The Absolutely Awesome jQuery CookBook.

Follow him on twitter @suprotimagarwal.

No comments: