我是新手,有人可以告诉我在以下jquery中我做错了什么吗?我正在尝试解析xml文件.我没有任何错误...或输出 [英] I am a newbie, can someone tell me what I am doing wrong in the following jquery? I am trying to parse a xml file. I am getting no errors...or output

查看:53
本文介绍了我是新手,有人可以告诉我在以下jquery中我做错了什么吗?我正在尝试解析xml文件.我没有任何错误...或输出的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是新手,有人可以告诉我在以下jquery中我做错了什么吗?我正在尝试解析xml文件.我没有错误...或输出

I am a newbie, can someone tell me what I am doing wrong in the following jquery? I am trying to parse a xml file. I am getting no errors...or output

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<script type="text/javascript">
  $(document).ready(function()
     {
       $.ajax({
         type: "GET",
         url: "C:\Users\Owner\Documents\Development\javascripts\Mission.xml",
         dataType: "xml",
         success: parseXml
       });
     });
     //print the date followed by the title of each Mission
     function parseXml(xml)
     {
         $(xml).find("Mission").each(function()
         {
           $("#output").append($(this).attr("ID")");
           $("#output").append("," + $(this).attr("OrgID")");
           $("#output").append("," + $(this).attr("Name")");
           $("#output").append("," + $(this).attr("Date")");
           $("#output").append("," + $(this).attr("nTouched")");
           $("#output").append("," + $(this).attr("HowTouched")");
         });
     }
 </script>


这是示例输入数据:


here is sample input data:

推荐答案

(document).ready(function() {
(document).ready(function() {


.ajax({ 类型:"GET", 网址:"C:\ Users \ Owner \ Documents \ Development \ javascripts \ Mission.xml", dataType:"xml", 成功:parseXml }); }); //打印日期,后跟每个任务的标题 函数parseXml(xml) {
.ajax({ type: "GET", url: "C:\Users\Owner\Documents\Development\javascripts\Mission.xml", dataType: "xml", success: parseXml }); }); //print the date followed by the title of each Mission function parseXml(xml) {


(xml).find("Mission").each(function() {
(xml).find("Mission").each(function() {


这篇关于我是新手,有人可以告诉我在以下jquery中我做错了什么吗?我正在尝试解析xml文件.我没有任何错误...或输出的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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