使用ajax解析从服务器上的页面返回的xml [英] parse xml returned from a page on server using ajax

查看:69
本文介绍了使用ajax解析从服务器上的页面返回的xml的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在从服务器获取以下数据

i am getting folllowing data from the server

<allstudents>
    <student>
        <rollno>8001</rollno>
        <name>AAAA</name>
    </student>
    <student>
        <rollno>8002</rollno>
        <name>BBBB</name>
    </student>
</allstudents>


我有一个包含div的html页,其ID为"dvtbl"
现在我想在dvtbl内生成以下表格


i have html page containing div with id ''dvtbl''
now i want to generate the folllowing table inside of dvtbl

<table>
    <tr>
        <td><input type="checkbox" name="cbRoll" value="8001" id="cbRoll8001" /></td>
        <td>AAAA</td>
    </tr>
    <tr>
        <td><input type="checkbox" name="cbRoll" value="8002" id="cbRoll8002"/></td>
        <td>BBBB</td>
    </tr>
</table>


我该如何使用jQuery?在$ .ajax的回调函数中?


how do i do it using jquery? in the callback function of $.ajax ?

推荐答案

.ajax?


,您应该可以使用Jquery解析DOM
you should be able to use Jquery to parse the DOM


您可以使用jQuery.parseXML(): http://api.jquery. com/jQuery.parseXML/ [ ^ ]
You can use jQuery.parseXML() : http://api.jquery.com/jQuery.parseXML/[^]


这篇关于使用ajax解析从服务器上的页面返回的xml的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆