Home >Web Front-end >JS Tutorial >jQuery subform's method of obtaining parent form elements_jquery

jQuery subform's method of obtaining parent form elements_jquery

WBOY
WBOYOriginal
2016-05-16 15:59:531134browse

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);
The corresponding javascript version of

is

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

Get the element method of the parent window:

$(selector, window.parent.document);

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

$(selector, window.parent.parent.document);

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

$(selector, window.parent.document);

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

$(selector, window.opener.document);

Get the parent form opened through showModelDialog():

$(selector, window.dialogArguments.document);

Used to refresh the entire page of the parent window:

window.parent.location.reload();

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

parent.subWindow_add.Close();

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.

Statement:
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