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
Release: 2016-05-16 16:51:35
Original
878 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:
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
Latest Issues
About git staging area
From 1970-01-01 08:00:00
0
0
0
comet - How to clear php cache area
From 1970-01-01 08:00:00
0
0
0
'react-native-safe-area-context' module not found
From 1970-01-01 08:00:00
0
0
0
javascript - canvas crop empty area
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template