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

WBOY
Release: 2016-05-16 16:51:35
Original
865 people have browsed it

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");
}
});

}

});
Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template