exclude printer codes not working

kimber Jun 14, 2012 10:34AM EDT

Hello, I need to exclude the printer button and have in the header:

<script type="text/javascript">var addthis_config = {"data_track_clickback":true,services_exclude : 'print'};</script>
<script type="text/javascript" src="http://s7.addthis.com/js/250/addthis_widget.js#pubid=kimber"></script>

-- and in the body ---


<!-- AddThis Button BEGIN -->
<div class="addthis_toolbox addthis_floating_style addthis_32x32_style" style="left:50px;top:50px;">
<a class="addthis_button_preferred_1"></a>
<a class="addthis_button_preferred_2"></a>
<a class="addthis_button_preferred_3"></a>
<a class="addthis_button_preferred_4"></a>
<a class="addthis_button_compact"></a>
</div>
<script type="text/javascript">
if (typeof addthis_config !== "undefined") {
addthis_config.services_exclude = 'print'
} else {
var addthis_config = {
services_exclude: 'print'
};
}
</script>
<script type="text/javascript">var addthis_config = {"data_track_addressbar":true};</script>
<script type="text/javascript" src="http://s7.addthis.com/js/250/addthis_widget.js#pubid=kimber"></script>
<!-- AddThis Button END -->


What do I need to do to exclude the printer button?

Thank you
Kimberly

1 Community Answers

Paul Jun 14, 2012 11:57AM EDT

By declaring the addthis_config variable a second time you're overriding the settings in the head. Remove the code from the head and add the services_exclude to the addthis_config variable in the body. Please note that excluding the print service will only mean that it's not available in our menu. People will still be able to print the page using their browser's print command.

For more information on variable scoping in JavaScript, go here: http://stackoverflow.com/questions/500431/javascript-variable-scope


Post Your Public Answer

Your name (required)
Your email address (required)
Answer (required)

Still need help?


General Topics

 

Developers