Ajax post request jump page, ajaxpost request jump

Source: Internet
Author: User

Ajax post request jump page, ajaxpost request jump

Recently, due to the company's requirements, ajax post requests are required to jump to the interface. I searched the internet for information, and almost all of them use Windows. location. but the request parameters are exposed in the address bar of the Request page. This is not safe.

$. Post (url, {method: "regist", userName: $ nameEle. val (), email: $ emailEle. val (), password: $ passwordEle. val ()}, function (data) {// successful registration page Jump, window. location. href = ".. /yiliaoqixie/login.html? Name = "+ $ nameEle. val ();});

Therefore, we can only think of using form for post submission.

<Form method = "post" action = "action" id = "fm"> </form> $. post (url, {method: "regist", userName: $ nameEle. val (), email: $ emailEle. val (), password: $ passwordEle. val ()}, function (data) {// after successful registration, the page jumps, var fm = document. getElementById ("fm"); fm. submit ();});

The above is the Ajax post request jump page introduced by the editor. I hope it will help you. If you have any questions, please leave a message and the editor will reply to you in time. Thank you very much for your support for the help House website!

Related Article

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.