Jquery returns the base case results, while jquery returns the case
<! Doctype html>
Case study of Jquery + ajax Implementation of partial refresh
Take adding a user as an example. This is part of the jsp code.
<% @ Page language = "java" contentType = "text/html; charset = UTF-8"
PageEncoding = "UTF-8" %>
<! DOCTYPE html PUBLIC "-// W3C // dtd html 4.01 Transitional // EN" "www.w3.org/TR/html4/loose.dtd">
<Html>
<Head>
<Title> New User </title>
<Link rel = "stylesheet"
Href = "$ {pageContext. request. contextPath}/common/css/plantform/common.css"
Type = "text/css"/>
<Script type = "text/javascript"
Src = "$ {pageContext. request. contextPath}/common/js/jquery-1.7.js"> </script>
<Script type = "text/javascript"
Src = "$ {pageContext. request. contextPath}/common/js/jquery. artDialog. js? Skin = blue"
Charset = "UTF-8"> </script>
<Script type = "text/javascript"
Src = "$ {pageContext. request. contextPath}/common/js/iframeTools. js"
Charset = "UTF-8"> </script>
<Link
Href = "$ {pageContext. request. contextPath}/common/css/plantform/list.css"
Rel = "stylesheet" type = "text/css"/>
<Link
Href = "$ {pageContext. request. contextPath}/common/css/plantform/index.css"
Rel = "stylesheet"... full text>
How does jquery implement form submission without refreshing a new page?
Jquery has an ajax method that implements Asynchronization (that is, you can call this method), and then you bind the onsubmit event of the form to asynchronously access the page you want to submit, return false (This page will not be submitted), you can implement the form commit without refreshing, the Code is as follows:
$ (Document). ready (function (){
// Use jQuery to submit forms Asynchronously
$ ('# Form id'). submit (function (){
JQuery. ajax ({
Url: 'page to be submitted ',
Data: $ ('# form id'). serialize (),
Type: "POST ",
BeforeSend: function ()
{
// The operation to be performed before asynchronous submission
},
Success: function ()
{
// The operation to be performed after the asynchronous submission is successful
}
});
Return false;
});
});