添加 - 这个紧凑的按钮不能在ajax加载html中工作

<span style="padding-left:5%;">
  <a addthis:url="demo_page" class="addthis_button_compact">
  <img src="share1.png" width="16" height="16" border="0" alt="Share" />
  </a>
</span>

this is the html,I am appending on ajax responce,which uses addthis_button_compact.I have tried several available solution,but nothing work for me.but the same code is working fine with non ajax data.

with little R&D I did it myself ,actually have to add class in span

<span class='addthis_toolbox'>,then have forcefully script
  <script>
   var addthisScript = document.createElement('script');
    addthisScript.setAttribute('src', 'http://s7.addthis.com/js/300/addthis_widget.js#domready=1')
    document.body.appendChild(addthisScript);
    var addthis_config = addthis_config||{};
    addthis_config.pubid = 'PUB-ID'; 
 </script>

then you have to recall the script in ajax responce,after page load completes

addthis.toolbox('.addthis_toolbox');

thankyou