jeongwon
[Error] Ajax 를 이용한 이미지 파일 삭제 시 오류 본문
상황:
Ajax 를 이용하여 미리보기 출력한 이미지 원본을 삭제하고, 미리보기 화면을 hide() 또 는 remove() 를 이용해 보이지 않게 하려고 했으나,
기존 img src="" 주소를 먼저 읽어들임으로써 success 이하의 코드가 실행되지 않는 상황.
해결:
비동기식 => 동기식 설정
$("#fileDel").click(function(){
if(confirm('삭제하시겠습니까?')){
$.ajax({
type:"post",
url:"${path}/admin/popup_file_delete.do",
async: false,
data: {"no":"${dto.no}"},
success: function(result){
if(result=='deleted'){
$("#fileImage").remove();
alert('삭제되었습니다.');
}
}
})
}
});
'Error log' 카테고리의 다른 글
[Error] ORA-01745: invalid host/bind variable name (0) | 2022.11.13 |
---|---|
[Error] The expression 'list' evaluated to a null value. (0) | 2022.11.08 |
[Error] button onclick location.href 가 작동 안될 때 (0) | 2022.11.08 |
[Error] org.apache.ibatis.ognl.OgnlException: source is null for getProperty(null, "id") (0) | 2022.11.08 |
[참고] 영문 자간이 넓어졌을 때 (0) | 2022.11.02 |