我有一个XML文件,如下所示。我如何使用Jquery读取所有元素。请注意,我不知道孩子元素名称处理文件如何使用Jquery读取元素的所有子元素
<Skills> <Programming>Yes</Programming> <Networking>No</Networking> <ProjectMangement>Yes</ProjectMangement> </Skills> $.ajax({ url: 'application_form.xml', dataType: "xml", success: parse, error: function(){alert("Error: Something went wrong");} }); function parse(document){ $(document).find("Skills").each(function(i,e){ //here i want to get the name of all the child elements }); }
会有独生子女,或孩子的孩子吗?你只想要孩子吗? –
的问题是,这XM L文件正在动态更新,并且在处理文件时我不知道孩子的名字。所以我不能通过他们的名字来访问节点。 – Duleendra
@shashi这是固定的,甚至这个变化呢? –
swapnesh