工作记录----获取XML文件的配置信息

来源:互联网 发布:淘宝账期延长怎么解除 编辑:程序博客网 时间:2024/06/05 23:50

js代码:

function getIP() {        $.ajax({            url: "../public/config/server.xml",            dataType: 'xml',            type: 'GET',            timeout: 2000,            error: function(xml)            {                alert("加载XML 文件出错!");            },            success: function(xml)            {                IP = $(xml).find("config").children("ip").text();            }        });    }  

xml结构:

<config><!-- 服务器的ip地址在请这里配置 -->    <ip>192.168.0.1:8080</ip></config>
0 0