Default Code
Default Menu Code
This will create the default menu that can be used on any website. You can start with this code, or generate your own by selecting Get Your Button.
<!-- ADDTHIS BUTTON BEGIN -->
<script type="text/javascript">
var addthis_config = {
username: "YOUR ADDTHIS USERNAME"
}
</script>
<a href="http://www.addthis.com/bookmark.php?v=250"
class="addthis_button"><img
src="http://s7.addthis.com/static/btn/v2/lg-share-en.gif"
width="125" height="16" border="0" alt="Share" /></a>
<script type="text/javascript" src="http://s7.addthis.com/js/250/addthis_widget.js"></script>
<!-- ADDTHIS BUTTON END -->
The Code is split into three sections: Inline Javascript, HTML, and External Javascript.
HTML
This is where the button is defined. You can make changes here to customize the button image and behavior.
<a href="http://www.addthis.com/bookmark.php?v=20" class="addthis_button"><img src="http://s7.addthis.com/static/btn/v2/lg-share-en.gif" width="125" height="16" border="0" alt="Share" /></a>
Inline Javascript
Settings for your share menu are set here. This code must be on the page before the external Javascript. Settings here will apply to all share buttons on the page.
username(recommended)- Your AddThis user id. This required if you want to view analytics for your menu.
<script type="text/javascript">
var addthis_config = {
username: "YOUR ADDTHIS USERNAME"
}
</script>
External Javascript
This is the code that creates the AddThis menu. You should only include this code once on your page - even if you have more than one share button. This code can be included anywhere in your page's code. It does not have to be in the header.
<script type="text/javascript" src="http://s7.addthis.com/js/250/addthis_widget.js"></script>