저는 jquery에 새로 익숙하지만 다음을 시도하고 있습니다. 링크를 클릭하고 replaceWith() 양식을 클릭하고 양식에서 제출을 클릭하면 두 번째 jquery 함수가 ajax 호출과 다른 replaceWith(). replaceWith() 및 두 번째 jQuery 함수
이
이 두 가지 기능$(function addtop10fromuserpage() {
$(".addshowtotop10").click(function() {
var button = $(this);
button.replaceWith('<form><input class="addtop10userinput" type="text" name="seriesname" /><input type="submit" class="button small addtop10usersubmit" value="Add" /></form>');
});
});
$(function addtop10fromuserpageshowadd() {
$(".addtop10usersubmit").click(function() {
var button = $(this);
var position = button.closest(".top-rating").find(".top-rating-text").html();
alert('position');
});
});
Bascially 자들은 개별적으로 호출되는 경우, 두 기능은 잘하지만 나는 replacewith 양식에서 두 번째 함수를 호출하는 경우, 그것은 작동하지 않습니다. 왜 그런가요?
감사합니다. 요소가 동적으로 생성되기 때문에
http://api.jquery.com/on/ –