Home >Web Front-end >JS Tutorial >Area area realizes the js writing method of post submission data_javascript skills

Area area realizes the js writing method of post submission data_javascript skills

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-05-16 16:51:35880browse

In the mvc area, implement the js writing method of post submission data!

Copy code The code is as follows:

$("#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(" Posted successfully, we will notify direct sellers to reply as soon as possible");
window.location.reload();
} else if (data== 1) {
alert("You can't leave a message for yourself! ~");
} else(data== 3) {
alert("Not logged in yet, please log in first before posting a comment");
}
});

}

});
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn