2
Ich benutze Ajax, um eine neue Seite zu laden, aber es zeigt nur die Aktien-Tasten und nicht die Anzahl der Aktien anzeigen.share buttons zählen funktioniert nicht auf dynamisch geladene Seite
$("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) {
});
});
Dieser Kommentar ist nicht relevant für das Problem, aber ein Zeiger auf Ihren anderen Fehler im Code $ .getScript ("http://ws.sharethis.com/button/buttons.js"); 'Dies wird geladen Das selbe Skript so oft wie das 'a' angeklickt wird, was zu einem Problem führt. –
@Reddy Danke Ich werde das ändern. –
Können Sie auch Ihre Antwort html? –