티스토리 뷰
<img src="test.png" id="PhotPath" onError="javascript:this.src='<%= ctxPath %>/image/img_err.png'" />
test.png 파일을 찾을 수 없는 경우 onError 이벤트의 의 대체 이미지를 보여 준다.
JQuery 에서는 아래와 같이 사용 할 수 있다.
$("#PhotPath").attr({src:'<%= PhotPath %>' });
$("#PhotPath").error(function(){
$(this).attr("src","/photo/NoPhoto.gif");
});
댓글
공지사항
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
TAG
- Android
- Compile
- SSL
- ssh
- json parse
- Mobile
- Fun
- web
- devel
- MySQL
- Flutter
- place
- development
- 엘리스센터
- Spring
- JavaScript
- samba
- Java
- HTTP
- Linux
- Review
- devtools
- Security
- kotlin
- dart
- gpkiapi
- 맛집
- food
- TIP
- springboot
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | ||||
4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 | 19 | 20 | 21 | 22 | 23 | 24 |
25 | 26 | 27 | 28 | 29 | 30 | 31 |
글 보관함