English 中文(简体)
j Query Ajax POST未成功
原标题:jQuery Ajax POST unsuccessful

I m 无法利用jquery s ajax功能成功填补。

运行页的URL为http:// localhost:9999/,目标(网络服务)的URL为http:// localhost:8080。 港口没有相同,分别为999个和8080个。

下面是请求书和jquery ajax代码。

<>Request:

OPTIONS /profile/set_member HTTP/1.1
Host: localhost:8080
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.8) Gecko/20100722 Firefox/3.6.8
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 115
Connection: keep-alive
Origin: http://localhost:9999
Access-Control-Request-Method: POST

www.un.org/Depts/DGACM/index_spanish.htm Query ajax Code:

$.ajax({ 
        type: "POST", url: "http://localhost:8080/profile/set_member", 
        contentType: "application/json", data: member, 
        error: function(){ alert( Update failed! ); }, 
        processData: false, 
        success: function(){ alert( Update successful! ); }
});
最佳回答

这是一个横跨阿加西电话的问题。 基本上(至少是第2条),出于安全原因,将一项《组织条例》申请改为《组织条例》。 昨天晚上,我看上去了同样的exact

https://stackoverflow.com/questions/3578614/wcf-ajax-quest-not-working-with-jquery-ajax> Ajax 不使用Jquery美元

我用一个美元呼吁我到当地厅:23485美元,到网站。 在国际空间法研究所主办。 由于它们是不同的领域,交叉钥匙被打脚踢,使事情变得困难。

问题回答

• 代表你称之为“jax”,例如PHP:

<?php /* get.php */
    $url = $_GET["Url"];
    echo file_get_contents($url);
?>

请您:

$.ajax({ url: "get.php?Url=realurl.com" });

那是一回事。

是什么手s? <代码>successerrorhandler? 您能否详细阐述“单项工作”的含义?

或许请<代码>alerterror上提供更多信息。 手工艺:

error: function(XMLHttpRequest, textStatus, errorThrown) {
   //console.log is better at least for debugging. You can change this back to alert 
   //when your code goes into production
   console.log("Update unsuccessful. Status: ", textStatus, " error thrown: ", errorThrown);
}

。 应当让你了解问题可能是什么。 可能的数值是“时间外”、“频率”、“经修改的”和“质量”。 一旦发现实际错误,请更新问题。

另外,如果你检查了Net tab,看看要求和答复。 几个常见的错误来源:

  • Violating same-origin policy. You cannot make an AJAX to a different URL from the parent page.
  • Server-side errors. If your server returns something like a 500 response code, the request will fail.
  • Parsing errors. If you re expecting a specific response format like json or xml, and if the response is not in that format, the AJAX request will be unsuccessful.




相关问题
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 ...

热门标签