JSP Jump back code page easy Way ~

Source: Internet
Author: User

JSP jumps to the code-behind page. There are several methods, for example,:

Action mode;

jquery way, code as below:

function Regcust () {
$ (' #containerFRM '). Form (
' Submit ',
{
"url": "${webappurl}/cust/registereduser.html",
Onsubmit:function () {
Show Matte
$.jbox.tip ("Submitting ...", ' loading ');
},
Success:function (responsetext) {
$.jbox.closetip ();
If (' success ' = = ResponseText) {
/*$.jbox.tip ("Registration successful, 3 seconds after their own initiative to jump ...", ' success ');
Window.settimeout (function () {
Window.location.href = document.getElementById (' Strbackurl '). Value
}, 3000); */

$ ('. Themsmain '). HTML ("<div style= ' height:100px;margin-top:50px;text-align:center;font-weight:bold;font-size: 16px;line-height:36px; ' ><span class= ' red bold font16 ' > Congratulations, Register success!

</span><br/> System <span id= ' Time_span ' >3</span> seconds after their own initiative to jump ...<div><div> ");
Window.opener.location.reload ();
Intervalobj = Window.setinterval (settime, 1000);
}else{
$.jbox.error (' register failed ', ' hint ');
}

}
}, ' text ');
}

Ajax Way. Now for the AJAX approach, the code is as follows:

$.ajax ({
URL: "${webappurl}/cust/existsuser.html?user_sn=" +s,
Type: "Post",
DataType: "Text",
ContentType: "Application/text;charset=utf-8",
Cache:false,
Async:false,
Success:function (data) {
if (' false ' = = Data | |!data)
{
Regcust ();
}else{
$.jbox.info (' username already exists, please enter ' again ', ' hint ');
}
}
}, ' text ');

Copyright notice: This article Bo Master original articles, blogs, without consent may not be reproduced.

JSP Jump back code page easy Way ~

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.