AddThis button will not work inside AJAX, but will

2019-03-13 17:15发布

Basically, this is what I'm doing. User visits site, loads "index.html" Within index.html, it automatically loads, through AJAX, "details.html" into a DIV. I put an ADDTHIS button on "details.html". However, for some reason , the roll-over doesn't work.

When I visit details.html in the browser, the roll-over works. I'm guessing it's because of the AJAX?

<a class="addthis_button"  href="http://www.addthis.com/bookmark.php?v=250&amp;pub=xa-4adf7e45288f5b21">
<img src="http://s7.addthis.com/static/btn/sm-share-en.gif" width="83" height="16" alt="Bookmark and Share" style="border:0;margin-top:16px;"/></a>
<script type="text/javascript" src="http://s7.addthis.com/js/250/addthis_widget.js#pub=xa-4adf7e45288f5b21"></script>

7条回答
Viruses.
2楼-- · 2019-03-13 18:08

Add this snippet of .js to the .html you are loading. Replace "#atbutton" with your button's selector.

addthis.button("#atbutton");
查看更多
登录 后发表回答