ajax 요청 질문드립니다. 자꾸 실패한다고 뜨네요
본문
$(function() {
$(".follow").click(function()
{
var user_id = $(this).attr("id");
var datastring = 'user_id='+ user_id ;
$.ajax({
type: "POST",
url: "./add_follow_user.php",
data: datastring,
success: function(html){
alert("Ajax통신 성공 "+html);
},error: function (html) {
alert("Ajax 연결 실패"+html);
}
});
$("#follow"+user_id).hide();
$("#remove"+user_id).show();
return false;
});
});
답변 1
크롬브라우져를 사용하시는지는 모르겠는데 개발자에게 좋은 툴을 제공합니다.
F12 를 클릭하면 Developer Tools 가 뜹니다.
Network 탭에 보시면 페이지에서 실행되는 모듈이 뜹니다.
그중에서 add_follow_user.php 파일이 보이실꺼예요.
클릭하시면 우측 영역에 Headers 정보가 보입니다.
상단에 보시면 Headers, Preview, Response, Cookies , Timing 탭이 있어요.
Preview 탭을 눌러보시면 add_follow_user.php 의 오류메시지가 보이실껍니다.
답변을 작성하시기 전에 로그인 해주세요.