English 中文(简体)
AJAX公司没有提出要求?
原标题:AJAX put request failing?
  • 时间:2010-03-10 16:30:13
  •  标签:
  • ajax

使用以下代码执行ajax get请求可以正常工作:

$.ajax({
   type: "GET",
   contentType: "application/json",
   url: "http://someSeceretUrl/test/document,
   dataType: "jsonp",
   success: function(msg) {
   console.log(msg);
   },
   error: function(a,b,c) {
     console.log(a);
     console.log(b);
     console.log(c);
}
});

但PUT ajax呼吁使用以下代码:

$.ajax({
   type: "PUT",
   contentType: "application/json",
   url: "http://someObscureURL/test/mrmer1",
   dataType: "jsonp",
   data: {"name":"mike"},
   success: function(msg) {
      console.log(msg);
   },
   error: function(a,b,c) {
     console.log("XMLHttpRequest: " + a);
     console.log("textStatus: " + b);
     console.log("errorThrown: " + c);
  }
  });

成果如下:

XMLHttpRequest: [object XMLHttpRequest]
textStatus: null
errorThrown: [Exception... "Access to restricted URI denied" code: "1012" nsresult: "0x805303f4   (NS_ERROR_DOM_BAD_URI)" location: "http://static.kobj.net/kobj-static-20100219162227.js Line: 371"]

I am thinking that something is blocking the PUT request, but I don t know. What am I doing wrong?

感谢!

最佳回答

页: 1 如果将<代码>http://username:password@somehost视为交叉领域,我将不感到惊讶。

问题回答

当我过去提出要求时,我发现,不通过Length头盔导致出现一种例外,只是一种思想。





相关问题
ajax login using httpRequest?

I am trying to develop my login script to give feedback to the user if the login is valid or not. Basically if it isn t correct a div box will show saying its wrong, if its correct it will show its ...

Virtual Tour using sketch up, ajax, flash technologies

I want to know if there are existing technology that make your 3d models in sketch into virtual tours, using either Ajax or Flash for web presentation. If there s none, which will be a good approach ...

How can i update div continuously

I have asp.net application where i have a div which showing the value from other site. The value of that site is changing continuously. I want that my div will automatically update in some interval ...

热门标签