代码如下:
- JScript code
$(document).ready(Test()); function Test() { //var linexml = 'lineinfo/line' + '@(ViewBag.lineid)' + '.xml'; alert("TesT执行了!") $.ajax({ url:"lineinfo/line20000301.xml", dataType:"xml", type: "get", success:function(xmldoc){ alert($(xmldoc).find("name").text()); } }); }
加载页面后可以弹出“TesT执行了”,但后面的没有任何反应,浏览器也不报错,请问达人指点问题出在哪里?
------解决方案--------------------
楼主是不是在ie下测试,并且双击html 来测试的?
需要配置web服务器,以http://.../test.html 这样的方式来访问。
------解决方案--------------------
//alert($(xmldoc).find("name").text());
alert(xmldoc); //这样会弹出么