The Area Area implements the js method of post submission data

  • 2020-03-30 02:43:34
  • OfStack

In the MVC area to achieve post submitted data js writing method!
 
$("#btnSava").click(function () { 
if ($("#text").val()=="") { 
alert(" Please enter what you want to say! ~ ! "); 
} else { 
$.post("/control/action", { id: $("#text").val()}, function (data) { 
if (data == 0) { 
alert(" Published successfully , We will inform the distributors to reply as soon as possible "); 
window.location.reload(); 
} else if (data== 1) { 
alert(" Can't give oneself message of oh! ~"); 
} else(data== 3) { 
alert(" Not yet logged in, please log in before commenting "); 
} 
}); 

} 

}); 

Related articles: