尝试删除值时出现以下弹出窗口。我正在使用 jQuery Ajax 删除该值。我使用的编程语言是python2.7,框架是Django 1.3.2
我的代码如下:
$.ajax({
type: "DELETE",
url: window.location.pathname + id + '/data-centers/' + dc,
contentType: 'application/html; charset=utf-8',
data: {
dc : dc,
},
success: function(){
alert("success");
}
etc...
当我确认删除该值时,我从 JavaScript 中得到以下弹出窗口:
"This web page is being redirected to a new location. Would you like to resend
the form data you have typed to the new location?
在 Ajax 标头中,我可以看到以下内容(它试图重定向到其他位置,但不知道为什么):
Connection Keep-Alive
Content-Encoding gzip
Content-Length 251
Content-Type text/html; charset=iso-8859-1
Date Tue, 27 Nov 2012 13:53:44 GMT
Keep-Alive timeout=5, max=100
Location http://www.test.com/403/test-403.html
Vary Accept-Encoding
Request Headers
Accept */*
Accept-Encoding gzip, deflate
Accept-Language en-us,en;q=0.5
Connection keep-alive
Content-Length 12
Content-Type application/html; charset=utf-8
这只发生在我尝试使用 DELETE 时。