【发布时间】:2010-01-14 19:54:44
【问题描述】:
我正在尝试通过 AJAX 获取 http://lib.softvoyage.com/cgi-bin/gate_dest_hotels.xml?code_ag=nwi&alias=tpi&language=en&with_cdata=y,但它不断返回 nadda(此处的萤火虫截图:http://img683.imageshack.us/img683/3279/firebug.jpg)
下面是代码:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<title>Search Form</title>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
</head>
<body>
<form method="post" action="#">
<label for="gateway_dep">Leaving From:</label>
<select id="gateway_dep" name="gateway_dep">
<option value="">Select a gateway</option>
<option value=""></option>
<option value="">Loading gateways</option>
</select>
</form>
<script type="text/javascript">
<!--
$(document).ready(function() {
$.ajax({
url:"http://lib.softvoyage.com/cgi-bin/gate_dest_hotels.xml?code_ag=nwi&alias=tpi&language=en&with_cdata=y",
cache:false,
dataType:"text",
type:"GET",
success:function(xml) {
alert(xml);
}
});
});
-->
</script>
</body>
</html>
【问题讨论】: