Home > Web Front-end > JS Tutorial > body text

jQuery subform's method of obtaining parent form elements_jquery

WBOY
Release: 2016-05-16 15:59:53
Original
1105 people have browsed it

The example in this article describes how a jQuery subform obtains parent form elements. Share it with everyone for your reference. The details are as follows:

$("#父窗口元素ID",window.parent.document);
Copy after login
The corresponding javascript version of

is

window.parent.document.getElementById("父窗口元素ID");
Copy after login

Get the element method of the parent window:

$(selector, window.parent.document);
Copy after login
Copy after login

To get the element of the parent window of the parent window, you can use:

$(selector, window.parent.parent.document);
Copy after login

Similarly, the method of selecting other windows is similar
Get iframe parent form element:

$(selector, window.parent.document);
Copy after login
Copy after login

Get the parent form opened through windows.open():

$(selector, window.opener.document);
Copy after login

Get the parent form opened through showModelDialog():

$(selector, window.dialogArguments.document);
Copy after login

Used to refresh the entire page of the parent window:

window.parent.location.reload();
Copy after login

The window plug-in closes the window, similar to window.close():

parent.subWindow_add.Close();
Copy after login

Refresh the list with the id "4thEditTable" in the parent page (partial refresh):

Copy code The code is as follows:
parent.$("#4thEditTable").load(window.parent.location.href " #4thEditTable");

I hope this article will be helpful to everyone’s jQuery programming.

Related labels:
source:php.cn
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template