Ajax submits the form and closes the popup window while loading the Refresh parent page

Source: Internet
Author: User

Some students must have encountered such a problem:

When the pop-up window is opened by the layer plugin, the popup cannot be closed after the form is submitted by jquery Ajax, or the parent page is not refreshed after the popup window is closed. How to solve the problem.

come on, guys, watch it together. Solution:


function SubmitForm () {
	//Gets the value of the form item (slightly)			
	//submits the form data
	$.ajax ({
		URL: "Slightly",
		type: "POST",
		data: slightly, 
		dataType: "Text",
		success:function (data) {
			//Load Refresh parent class page and close popup
			window.parent.location.reload ();
			Parent.layer.closeAll (' iframe ');

		},
		error:function (XHR) {
			alert (xhr.status)
		}
	);
};


If the above content is inappropriate, hope that the students of the great God. Thank you.


Copyright NOTICE: This article for Bo Master original, if reproduced please indicate the source.


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.