본문 바로가기

Web108

[Javascript] opener/부모창과 자식창의 데이터 교환/부모창/자식창/예제 부모창에서 자식창을 팝업으로 열었을 때자식창에서 행해진 Action에 따라 부모창에 영향을 줘야 하는 경우 opener를 사용한다.. opener객체는 자기 창을 연 부모의 window 객체를 참조한다.예제를 적어보자면.. 1. 부모창에서 popup을 통해 자식창 openparent.jsp자식창에서 Action 후 돌아올 function을 하나 만들어 주자 >> completeCallback $(document).ready(function(){ parent.init(); }); var parent ={ init : function(){ //팝업창 오픈 $('#popupOpenBtn).on('click',function (){ var url='' window.open(url,”test”,”height=10.. 2016. 9. 1.
[JSP] 화면새로고침/이전페이지/화면이동 location.reload(); //현재 창 새로고침 opener.location.reload(); //부모창 새로고침history.back(); //이전 페이지 호출location.href=url; //url값으로 화면 전환 2016. 8. 31.
[jQuery] jquery 클릭한 객체 속성값 추출 / closest find children 차이점 이야 뻘짓 했다~ 게시글 목록을 그리는데 다음과 같이 게시글 모두 _boardItems라는 class를 가지고 있고각 게시글마다 key값이 되는 docnum이라는 속성값을 가지고 있을 때게시글 상세보기를 위해 클릭한 객체의 속성값을 가져오는걸 하고 싶었다. 그래서 closest find등을 조합해서 찾으려고 뻘짓을 하다가………………………………………개념이 부족하다는 것을 꺠닫 -_-………………. (1) children은 선택한 객체의 바로 밑 !!!!! ex) $(this).children()(2) closest는 선택한 객체에서 가장 가까운거 !!!! ex) $(this).closest(‘td’) >>지금 같은 경우는 closest로 td를 찾았으면 가장 첫 번째 td를 찾아서 속성값을 못 가져왔을 것(.. 2016. 8. 5.
[jQuey]form과 ajax / form submit 막기 / onsubmit="return false;" [jQuey] form과 ajax / onsubmit / 자동클릭(trigger) 게시판을 개발하다 보면 (이외 다른 것에도 ), 검색박스에 찾고자 하는 keyword를 입력 후검색을 해야 할 경우가 꼭 (늘상….) 있다. 방법은1) 검색버튼을 직접 클릭하거나2) 검색 input 박스에서 enter키 누르거나 필자는 두 방법을 다 개발하는데 , 소스 버전업 중2)번에 대한 case를 수정개발하다 이상한 현상(?)을 발견했다. $('#keywordBox').keydown(function(e) { if (e.keyCode == '13') { $('#boardSearchBtn').trigger('click'); }}); //검색$('#boardSearchBtn').on('click',function (){ _.. 2016. 8. 5.
[javascript] 라디오 버튼 제어 1. 특정 라디오 버튼 선택 $("input[id='r4']").on('click',function (){ }); 2. 복수 라디오 버튼 선택 $("input[id='r1'], input[id='r2'], input[id='r3']").on('click',function (){ }); 3. 특정 라디오 버튼 선택되게 $('input:radio[name="testRadio"]:radio[_testYN="Y"]').prop("checked",true); 4. 선택된 값이 있나 체크 If( $('input:radio[name="testRadio"]:radio[_testYN="Y"]').length 2016. 7. 20.
[jQuery] datepicker 예제 두개의 달력 ()~() 범위에서 minDate, maxDate 설정@@ $("#datepicker1").datepicker({dateFormat:'yy-mm-dd',showMonthAfterYear : true,changeMonth : true,changeYear : true,numberOfMonths:1,showOn:'both',buttonImage:'/images/iconCalendarSmall.gif' ,buttonImageOnly :true ,buttonText :"날짜선택",dayNamesMin : ['일','월','화','수','목','금','토'],monthNamesShort:['1월','2월','3월','4월','5월','6월','7월','8월','9월','10월','11월','12월'],.. 2016. 7. 20.