我正在使用IIS Express运行ASP.NET MVC网站。
例如,我设置了这个测试页面:
<!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>
<title></title>
</head>
<body>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js" language="javascript" type="text/javascript"></script>
<script language="javascript" type="text/javascript">
var carServiceUrl = "http://localhost:43889/cars";
$(document).ready(function ()
{
$.ajaxSetup(
{
cache: false,
dataType: "json"
contentType: "application/json"
});
});
get();
function get()
{
var url = carServiceUrl;
$.ajax({
cache: false,
type: "GET",
async: true,
url: carServiceUrl,
dataType: "json",
success: onGetCarsSuccess
});
}
</script>
</body>
</html>
问题在于当我启动FireBug并加载此页面时,get()方法被调用,但请求的查询字符串中添加了某种值(例如:
http://localhost:43889/cars?_=1381820301163
),我不知道它是如何出现的。我不知道是否因为我在MVC项目中运行此代码或者我是通过IIS Express运行所有内容。通常我使用纯IIS,所以不确定。我不知道为什么请求会添加
?_=1381820301163
。我从未在我的jQuery调用中指定过这个值。