var url="http://fsa.citop.in/lnct/service/signProcess.aspx";
var data={txtLogId: "abc@xyz.com",txtLogPass: "xyz",hdnReqType2: "sign87162"};
var success=function(data, textStatus, jqXHR) {
console.log(data);
};
var fail=function(jqXHR, textStatus, errorThrown) {
console.log("Error:" + errorThrown );
}
$.ajax({
type: "POST",
url: url,
data:data,
success:success,
error:fail,
});
Run Code Online (Sandbox Code Playgroud)
此POST请求在chrome SyntaxError: Unexpected token < in JSON at position 4
的页面" http://fsa.citop.in/lnct/ " 的控制台中给出了错误.
但是,如果我使用fsa.citop.in/lnct/service/signProcess.aspx
(即没有http://),它没有给我任何错误,但没有任何数据返回.在success
POST请求中,需要一个JSON对象.请有人解释这里发生了什么以及如何解决.