목록2010/07/02 (1)
정미나닷컴
[jQuery] jQuery를 이용한 xml 파싱
* xml 파일 - - 번호 제목 타입 * 소스 파일 $.ajax({ type: "get" ,dataType: "xml" ,url: "xml파일 주소" ,success: function(xml){ if($(xml).find("item").length > 0){ // null check $(xml).find("item").each(function(){ // item 수만큼 loop // item 요소 중 title 읽어오기. var title = $(this).find("title").text(); }); } } ,error: function(){ alert("xml error!!"); } });
IT
2010. 7. 2. 14:41