preventDefault 함수를 사용하여 양식 전송을 중지하고 있습니다. 이것은 잘 작동하지만, 그 함수 다음에 더 이상 작동하지 않는 onClick 함수가 있습니다.JQuery preventDefault()가 후속 함수를 중지하고 있습니다.
이상하게도, onclick 함수 앞에는 preventDefault 형식을 따른 간단한 div 중심 지정 기능이 있습니다.
편집 : onclick 함수는 첫 번째 함수에서 ajax를 통해로드 된 항목에 대한 문제였습니다. 이것에 어떤 도움이 아주 많이 주시면 감사하겠습니다
// Submit zip code
$("#get_zip").submit(function (zip)
{
//Send zipcode
$.ajax({
type: "POST",
url: "ajax_calls.php",
data: "zip="+$('#zip').val()+"&send_zip=true",
success: function(listing){$("#wrapper").html(listing); $("#lightbox,#welcome").fadeOut(300);},
error: function(){alert(3);$("#error").text("Could not retrieve posts").fadeIn(300).delay(900).fadeOut(300)}
});
//Stop form submission action
zip.preventDefault();
});
//Center item box
$("#item").centerInClient();
//When clicking an item row
$("tr.item").click(function()
{
// Get item id from selected row id
var id = $(this).attr('id');
//Fill item box with item details
$.ajax({
type: "POST",
url: "ajax_calls.php",
data: "id="+id+"&get_item=true",
success: function(r){$("#item_detail").html(r); $("#lightbox, #item").fadeIn(300);},
error: function(){alert(2);$("#error").text("Could not retrieve posts").fadeIn(300).delay(900).fadeOut(300)}
});
});
: 그래서 선택은 아마 그것을
을 발견하지 않은 것은 아래 내 코드입니다.
많은 감사 변경
나는 prevent.default와 함께 ajax도 사용하려고합니다. 그러나 그것은 아약스 안에서 일하는 것을 멈 춥니 다! –