2012-06-10 3 views
0

저는 XML 기반 UI에서 실행 취소/다시 실행 기능을 개발하고 있습니다. JQuery i로드, XML 노드 읽기 및 업데이트를 사용하고 있습니다.jQuery 대기열 시퀀스 업데이트 XML

undo_xml=actual_xml;      //save the actual xml state before to update it, 
$(this).attr("xmlattribute",newvalue); //update a specific node with a new value 
redo_xml=actual_xml;      //save the updated xml as the redo state 

이 문제는 항상 이전 undo_xml=actual_xml보다 istruction $(this).attr("xmlattribute",newvalue); 실행, 그래서 원하는대로 내가 undo_xml를 기록하지 않았다.

나는 $.queue(), jquery.stackevent() 및 많은 다른 방법을 시도했다.

그러나,

$(this).attr("xmlattribute",newvalue);

는 항상 XML var에 할당하기 전에 실행됩니다.

답변

0

나는 혼자 해결책을 찾았지만, 순서 문제가 아니라 자원 문제입니다.

이 정보가 도움이되기를 바랍니다.

undo_xml=$(actual_xml).clone();   //save the actual xml state before to update it, 
$(this).attr("xmlattribute",newvalue); //update a specific node with a new value 
redo_xml=$(actual_xml).clone();   //save the updated xml as the redo state