반응형
2 depth dynamic select box
jquery ajax으로 선택에 따라 달라지는 서브메뉴를 db에서 불러와야했음 ㅎ
html :
js :
function fnGetCtgSub(sParam){ var $target = $("select[name='ctg_sub_name']"); $target.empty(); if(sParam == ""){ $target.append(""); return; } $.ajax({ type: "POST", url: "/pages/etc/GetCtgSubList.php", async: false, data:{ P_NO : sParam }, dataType: "json", success: function(jdata) { if(jdata.length == 0){ $target.append(""); }else{ $(jdata).each(function(i){ $target.append(""); }); } }, error:function(xhr){ console.log(xhr.responseText); alert("지금은 시스템 사정으로 요청하신 작업을 처리할 수 없습니다.\n잠시 후 다시 이용해주세요."); return; } }); }
반응형
'프로그래밍 > JavaScipt' 카테고리의 다른 글
javascript 카카오네비 api 연동 (0) | 2017.07.21 |
---|---|
javascript google map api 반경내 업체 표시하기 (2) | 2017.07.17 |
javascript http html5 geolocation api 사용제한 (0) | 2017.07.10 |
javascript daum 주소검색 api https (0) | 2017.06.27 |
javascript iOS 10 모바일웹 pinch-to-zoom issue (user-scalable) (0) | 2017.03.23 |