2
新しいページを読み込むためにajaxを使用していますが、共有ボタンを表示していて共有数を表示していません。共有ボタンが動的に読み込まれたページでカウントされない
$("body a").click(function(e) {
$.ajax({
url: ajax_url,
type: "GET",
dataType: "xml"
}).done(function(data, textStatus, jqXHR) {
if (typeof(history.pushState) != "undefined") {
var obj = {
Title: title,
Url: url
};
history.pushState(obj, obj.Title, obj.Url);
} else {
alert("Browser does not support HTML5.");
}
var $divToFind = $($.parseHTML(jqXHR.responseText)).filter("#radio-main-wrapper");
$('#radio-main-wrapper').html($($divToFind).html());
$.getScript("http://w.sharethis.com/button/buttons.js");
stButtons.locateElements();
}).fail(function(jqXHR, textStatus, errorThrown) {
});
});
このコメントは問題とは関係ありませんが、他の間違いを指しているコード '$ .getScript(" http://w.sharethis.com/button/buttons.js ");これにより、 'a'が何度もクリックされたのと同じスクリプトです。これは問題を引き起こします。 –
@Reddyありがとう、私はそれを変更します。 –
あなたはあなたの応答htmlを掲載することはできますか? –