我是新手,有人可以告诉我在以下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() {