php - tweet button script not functioning when loaded in through ajax -
the twitter code below:
<script>!function(d,s,id){var js,fjs=d.getelementsbytagname(s)[0];if(!d.getelementbyid(id)){js=d.createelement(s);js.id=id;js.src="https://platform.twitter.com/widgets.js";fjs.parentnode.insertbefore(js,fjs);}}(document,"script","twitter-wjs");</script>
this code on page comments.php , gets loaded social.php when first load it.
twitter button works fine @ point.
however, when post comment , comments.php reloads social.php not reload, twitter script not work , tweet button doesn't appear.
please may me. sorry if unclear in way.
ok, should load twitter widget outside comments.php because script won't loaded via ajax.
that easier manage , avoid twitter widget loaded each time. there no need call script external source (twitter) each post, no efficient , error-prone.
by doing fix problem.
Comments
Post a Comment