0
나는 워드 프레스 웹 사이트를 만들고 있는데 문제가 있습니다. 여러 소셜 웹 사이트에서 소식을 공유 할 수있는 소셜 버튼을 추가했습니다.자바 스크립트가 아약스 호출 후 해석되지 않습니다.
다음 글을로드 할 무한 스크롤을 만들었습니다. 내 문제는이 자바 스크립트는 HTML 콜백을 내 페이지에 넣을 때 해석되지 않는다는 것입니다. 이 버튼은 자바 스크립트로 만들고 있습니다.
내 아약스 호출은 다음
(... HTML 태그) 나에게 워드 프레스 페이지의 모든 HTML을 반환 내 자바 스크립트 코드 :
$(window).scroll(function(){
if ($(window).scrollTop() == $(document).height() - $(window).height()){
// Are there more posts to load?
if(pageNum <= max) {
$.ajax({
type: "GET",
url:nextLink,
dataType: "html",
success : function(data) {
// Update page number and nextLink.
pageNum++;
nextLink = nextLink.replace(/\/page\/[0-9]?/, '/page/'+ pageNum);
var pageN = pageNum-1;
var div = $(data).find('.my-post-format');
// Add a new placeholder, for when user clicks again.
$('#pbd-alp-load-posts')
.before('<div class="pbd-alp-placeholder-'+ pageNum +'"></div>')
}
});
}
}
});
내 HTML 코드 :
<!-- Lockerz Share BEGIN -->
<li id="partager-article"> <a class="a2a_dd" href="http://www.addtoany.com/share_save?linkurl=<?php the_title() ?>&linkname=<?php the_permalink() ?>">share</a>
<script type="text/javascript">
var a2a_config = a2a_config || {};
a2a_config.linkname = "<?php the_title() ?>";
a2a_config.linkurl = "<?php the_permalink() ?>";
a2a_config.locale = "fr";
a2a_config.num_services = 6;
</script>
<script type="text/javascript" src="http://static.addtoany.com/menu/page.js"></script>
<!-- Lockerz Share END --></li>
내 데이터 변수에 내 태그가 있지만 $ (데이터)를 할 때이 태그가 사라집니다.
도움 주셔서 감사합니다.
그것은 작동하지 않는 것처럼, 여기에 데이터를 추가. – Sebastien