Use using JQuery to call a post request

post格式:$.post(“/Home/Index”,{Id:id},function (res){

  if(res. suc==true){

  $ .Messager.alert ( "Save Success");

  window.location.reload();

}

  else{

  $.messager.alert(res.message);

}

},“json”);

post method: The first parameter "Path Request"

  The second parameter, the parameter passed to the background

  The third parameter, which value of the callback function, the return path request a data processing method; (this is a callback function, in accordance with the first

  Return res data, determines whether or not the attribute res successful, then the successful execution of this determination operation successfully, else determining the errors that otherwise stored in given res)

  The fourth parameter is the type of background incoming data, such as: json text, etc.

Guess you like

Origin www.cnblogs.com/AChongi/p/11368819.html
Recommended