当前位置:编程学习 > C#/ASP.NET >>

xml异步读取

要的效果就是 在写入xml文件 的时候 也能访问xml --------------------编程问答--------------------
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>无标题页</title>
<script type="text/javascript" src="jquery-1.3.2.min.js"></script>
<script type="text/javascript">
    $(document).ready(function(){
        $.ajax({
            url:"XMLFile.xml",
            type:"get",
            success:function(result){
                $(result).find("item").each(function(i){
                    $("#img"+(i+1)).attr("src",$(this).attr("item_url"))
                })
            }
        })
    })
</script>
</head>
<body>
<img id="img1" src="" />
<img id="img2" src="" />
</body>
</html>
补充:.NET技术 ,  ASP.NET
CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,