데이터베이스를 업데이트하기 위해 Ajax/J-Query를 구현하고 싶습니다. 이제는 새로 고침/리디렉션하지 않고 cakephp에서 모든 ctp 페이지의 모든 내용을 다시로드해야합니다.cakephp에서 리디렉션/새로 고침없이 컨트롤러를 다시로드하는 방법
가능합니까?
도와주세요.
나는$.ajax({
url: 'http://localhost/projectname/Experiences/experienceadd',
type: 'POST',
data: {'companyname':companyname,'title':title,'monthstart':monthstart,'location':location,'yearstart':yearstart,'yearnextstart':yearnextstart,'monthnextstart':monthnextstart,'presentyeardata':presentyeardata,'description':description},
success: function (data) {
if(data)
{
mystr = '<div style="display: block; opacity: 1;" class="item mix book mix_all" data-year="2010"> <div class="pubmain"> <div class="pubassets"> <a href="#" class="pubcollapse"> <i class="icon-expand-alt"></i> </a> </div> <h4 class="pubtitle"> ' + companyname + '</h4> <div class="pubauthor"><strong>'+ title +'</strong>,'+ location+'</div> <div class="pubcite">'+ yearstart +' - '+ yearnextstart +' , <strong>'+ presentyeardata + '</strong> </div> </div> <div style="display: none;" class="pubdetails"> <h4>'+ description+'</h4> <div class="pubdetails"> <a class="icon_a icon_right_head" class="exp_rid" id="'+ data +'" href="javascript: void(0);"><i class="icon-trash"></i> Remove</a> <a class="icon_a icon_right_head" class="exp_eid" id="'+ data +'" href="javascript: void(0);"><i class="icon-pencil"></i> Edit</a> </div> </div></div>';
$('#pexperience_details').append(mystr);
$("#experience-box").hide(500, function() { });
$('#add-experience').show();
$().toastmessage('showSuccessToast','your skill is successfully Saved');
}
else
{
$().toastmessage('showErrorToast', 'your skill is not successfully Saved');
}
}
});
을 시도했지만이 하나 하나 개의 콘텐츠 영역을 추가 할 수 있습니다. 위의 코드가 필요없는 것보다 내 문제가 해결된다면. 어떤 아이디어 .....?
감사합니다.
네, 그것은 가능을 비활성화 할 수 있습니다 당신은 현재 아약스 함수 내에서이 아약스 함수를 호출 할 수 있습니다. 그러나 당신이 시도한 것을 우리에게 보여주세요. –
위의 것들을 시도했습니다. – Yash