티스토리 뷰

카테고리 없음

javaScript] Ajax

James Wetzel 2015. 9. 4. 14:51

$.ajax({

url: "/Category/ProductCategoryJR"

, data: { depth: depth, parentIDX: parentIDx }

, dataType: "json"

, method: "POST"

, beforeSend: function(jqXHR, settings) {

$(targetID + " > option").remove();

$(targetID).prepend("<option value=''>카테고리 수집중...</option>");

}

}).success(function(a, b, c) {

$(targetID + " > option").remove();

$(targetID).append("<option value=''>카테고리</option>");

$(a).each(function(index, element) {

if (a[index].Value == value) {

$(targetID).append("<option value=\"" + a[index].Value + "\" selected>" + a[index].Text + "</option>");

}

else {

$(targetID).append("<option value=\"" + a[index].Value + "\">" + a[index].Text + "</option>");

}

});

}).error(function(a, b, c) {

alert('[네트워크 오류] \n오류가 발생하여 작업을 완료할 수 없습니다.');

});

공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
«   2024/03   »
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
글 보관함