나는이은 iframe에서 다음 jQuery를 코드 :iframe 내에서 아약스 요청 후 맨 위로 스크롤하는 방법은 무엇입니까?
<script>
jQuery("#logBtn").click(function(){
jQuery("#content-promo").load("/path/to/file.php", function(response, status, xhr) {
if (status == "error") {
var msg = "Sorry but there was an error: ";
$("#error").html(msg + xhr.status + " " + xhr.statusText);
}else{ //update
$("html, body").animate({ scrollTop: 0 }, "slow");
}
});
return false;
});
</script>
어떻게 할 수 다시 AJAX 요청 후 상단에 iframe을 스크롤?