, 나는 append
, empty
, remove
와 그것을 시도하지만, 그들 모두는 ($ 아약스에 ) 같은 작동하지 않을 것 같다 :
success:function(xml){
$(xml).find("layout").append('<app id="' + $children.eq(i).attr("id") + '"></app>');
$(xml).find("layout").empty();
}
또한 Google에 대한 자습서가 없습니다. 그래서 jquery를 사용하여 xml에 노드를 추가하거나 삭제할 수 있습니까? OK
, 나는 세부 사항에 쓰기 xml 파일 그냥 데이터베이스/UserConfig를/config.xml에 같은 지역 도메인에 저장 여기 내 Ajax 코드입니다 :
function layout_change()
{
var $children=$input.children();
$.ajax({
type: "get",
url: "Database/UserConfig/config.xml",
dataType: "xml",
timeout: 2000,
beforesend:function(xml){
$(xml).find("layout").empty();
},
success:function(xml){
for(var i=0;i<$children.length;i++)
{
$(xml).find("layout").append('<app id="' + $children.eq(i).attr("id") + '"></app>');
}
},
error:function(){}
});
}
또는이 될 수 있습니다 자바 스크립트로 수행 또는 만 C#을 같은 서버 언어 수행 할 수 있습니다 ...... 여기
내 데모 XML된다?<layout>
<app id="id-4"></app>
<app id="id-5"></app>
<app id="id-6"></app>
<app id="id-1"></app>
<app id="id-2"></app>
<app id="id-3"></app>
</layout>
,
당신이 자바 스크립트로 뭔가를 할 수 있다면, 할 수있는 높은 기회가 있습니다 ... jquery – kobe
하지만 당신은 작성하거나 XML 파일, 자바 스크립트에서 텍스트 파일을 업데이트해서는 안된다, 좋은 접근 방식, 자바 스크립트입니다 주로 DOM 조작, 데이터 반입 및 표시, 데이터 전송 – kobe
xml 파일을 볼 수 있습니까? – Alex