본문 바로가기

전체 글

HTML5 CSS3 javascirpt 강좌 http://fromyou.tistory.com/412 더보기
SVG 란? http://seye2.egloos.com/2437974 더보기
검증에서 반복문 사용시 submit return 적용 $("#updateBtn").click(function(){ //검증 $(".screenid").each(function(index){ if($(".screenid:eq("+index+")").val()==""){ alert("화면 아이디를 모두 입력해주세요."); $(".screenid:eq("+index+")").focus(); return; } }); }); $("#detailCreateFrm").submit(); 위의 예제를 보면 JQeury의 each반복문을 이용하여 검증하고 있다. 이때 if 문으로 검증하고 return; 을 해줬을 경우 검증 자체를 빠져나올 줄 알았지만 반복문만 빠져나올 뿐 아래로 계속 프로그램을 실행하더라.. 결국 submit을 만나고야 마는데.. 아래와 같이 해결해 주었다.. 더보기
같은 클래스의 여러 요소 검증 $(".screenid").each(function(index){ if($(".screenid:eq("+index+")").val()==""){ alert("화면 아이디를 모두 입력해주세요."); $(".screenid:eq("+index+")").focus(); return; } }); 더보기
cos.jar 이용하여 파일 업로드 (미완 여러 파일 업로드) 파일 업로드에는 cos.jsr 라는 라이브러리가 필요하다. 해당 라이브러리를 lib폴더에 넣은 후에 작업 jsp에서는 form태그의 속성에 enctype="multipart/form-data" 이라고 설정해 준다 enctype을 설정하면 HttpServletRequest객체로 받질 못한다. cos.jar에서 제공해주는 MultipartRequest 객체를 이용하여 받도록하자. MultipartRequest multi = new MultipartRequest(req, uploadDir, 5 * 1024 * 1024, "utf-8", new DefaultFileRenamePolicy());//MultipartRequest(request객체, 업로드할 절대경로, 파일크기, 인코딩방식, 보안관련) 위와 같이 객.. 더보기
몇번째 요소인지 $(".tableclass").click(function(){alert($(this).index("table")); //table들 중 몇번째 테이블 인지}); 더보기
마이바티스 MyBatis order by 동적으로 (조건) 실행하기 rcode subject 더보기
전역변수 사용시 주의점 var orderbyset="asc";//정렬 초기값 $(document).ready(function(){sendGuest("","rcode",orderbyset);$(".setOrderBy").click(function(){var orderby = $(this).attr('id');sendGuest('',orderby,orderbyset);});}); function sendGuest(id,orderby,orderbyset){this.orderbyset = orderbyset=="asc"?"desc":"asc";:: 증상order by 를 동적으로 바꿔주기 위해서 작업중 전역변수로 선언한 값이 조건문으로 바꾸어봐도 적용되지 않음 해결this 더보기