본문 바로가기
728x90
반응형

js20

ajax 즐겨찾기 버튼 만들기 function favoBnt() { var memIdx = '${loginInfo.memIdx}'; var favoName = "공지사항"; $.ajax({ url : 'www.url.com', type : 'post', dataType : 'json', data : { memIdx : memIdx, favoName : favoName }, success : function(json) { if (json.resultCode == "0") { var inputBtn = []; if (json.favoInfo != null) { inputBtn.push(''); inputBtn.push(''); inputBtn.push('즐겨찾기'); inputBtn.push(''); } $("#addFavoBtn5")... 2021. 3. 23.
제이쿼리 html 함수 인자 싱글쿼테이션 사용.. $('#m_button_'+idx).html('수정'); $(selector).html( 'button type="button" onclick="function(\''+변수+'\',\''+변수2+'\')">something'); 함수안에서 문자열사용 하는 방법... 2021. 3. 12.
ajax 리스트 불러와서 화면쏴주기 function popMenuList(upIdx) { $.ajax({ url: '${ajaxUrl}', type: 'post', dataType: 'json', data: { upIdx: upIdx }, success: function(json) { if (json.resultCode == '0') { var listData = []; //listData.push(''); if (json.menuList != null) { $(json.menuList).each(function(i, item) { listData.push(''); listData.push(''); listData.push(''); listData.push(''); listData.push(' ' + item.MENU_NAME); list.. 2021. 3. 10.
제이쿼리 선택자 제이쿼리 선택자 $($(".list-tit > span")[5]).removeClass("st1"); 클래스 .list-tit 의 span 태그 인덱스 5의 st1클래스를 지운다. $($(".list-tit > span")[5]).removeClass("st1"); for(var i =0; i 2021. 2. 23.
ajax로 데이터 가져와서 js, jQuery 로 tbody만들기 testtest(); // data가져오기 function testtest() { $.ajax({ type: "post", url: "%%%%url%%%", cache: false, dataType: "json", success: function (json) { var temp= JSON.parse(JSON.stringify(json)); test(temp); }, }); function test(temp) { var contents = document.querySelectorAll("#section3 .contents-box")[0]; var tbody = contents.querySelector("tbody"); // 추후 tr 태그 삭제 코드 변경 또는 html 에서 제거 후 아래 라인 제거 $(t.. 2021. 2. 23.
append 사과 바나나 오렌지 딸기 망고 2021. 2. 15.
728x90
반응형