我正在通過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>
問題是,當我啓動螢火,和我加載該頁面,則get()被解僱,但要求有某種附加值在查詢字符串(例如http://localhost:43889/cars?_=1381820301163
),我不知道它是如何到達那裏。我不知道是否是因爲我在MVC項目中運行此項目,或者我是通過IIS Express或其他項目運行這些項目的。我通常使用直接的IIS,所以不確定。
我不確定爲什麼它甚至在請求中附加?_=1381820301163
。我從來沒有在我的jQuery調用中指定。
這是一個時間戳,但不知道爲什麼它出現 – Alex