Unexpected token < in JSON at position 4

前端 未结 2 910
时光说笑
时光说笑 2021-01-01 21:39
var url=\"http://fsa.citop.in/lnct/service/signProcess.aspx\";
var data={txtLogId: \"abc@xyz.com\",txtLogPass: \"xyz\",hdnReqType2: \"sign87162\"};
var success=funct         


        
2条回答
  •  北荒
    北荒 (楼主)
    2021-01-01 22:29

    It's most likely because the response is HTML and it's trying to parse it as something else. The < at position 4 is the first < of .

    You should try to specify dataType in your ajax call (see http://api.jquery.com/jquery.ajax/) and also make signProcess.aspx to return something more useful (currently the response content type is application/json but it prints HTML).

提交回复
热议问题