一聚教程网:一个值得你收藏的教程网站

最新下载

热门教程

jQuery读取XML文件的方法示例

时间:2017-03-12 编辑:简简单单 来源:一聚教程网

 

 代码如下 复制代码

 

 

  0

  500

  5

  0

 

 

  500

  2000

  10

  25

 

 

  2000

  5000

  15

  125

 

 

  5000

  20000

  20

  375

 

 

  20000

  40000

  25

  1375

 

 

  40000

  60000

  30

  3375

 

 

  60000

  80000

  35

  6375

 

 

  80000

  100000

  40

  10375

 

 

  100000

  99999999

  45

  15375

 

 代码如下 复制代码

functionStandardTaxRate()

{

  $.ajax({

    url:"/Resource/salaryTaxRate.xml",

    dataType:'xml',

    type:'GET',

    timeout: 2000,

    error:function(xml)

    {

      alert("加载XML 文件出错!");

    },

    success:function(xml)

    {

      $(xml).find("taxrate").each(function(i)

      {

        varoid = $(this).attr("id");

        varlower = $(this).children("lower").text();

        varupper = $(this).children("upper").text();

        varrate = $(this).children("rate").text();

        varbuckle = $(this).children("buckle").text();

        ///后续操作。。。

      });

    }

  });

}

热门栏目