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+'&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:
Tweet
No comments:
Post a Comment