Home  >  Article  >  Web Front-end  >  Solution to the problem that frameset cannot get the value under firefox_javascript skills

Solution to the problem that frameset cannot get the value under firefox_javascript skills

WBOY
WBOYOriginal
2016-05-16 18:20:131198browse

FF cannot directly access
through the ID of the Frame (IE FF can be accessed directly through the Name of the Frame, but FrameSet does not support the name attribute )

Therefore window.parent.full =》window.parent.document.getElementById("full");
Detailed explanation of js operation frame, the difference between window.opener and window.parent

If a page in the frame wants to change other pages in the same frame or the page in the parent frame, use parent
window.opener refers to the parent page of the page opened by window.open.

The window.frames object can reference pages in iframes or framesets.
Just replace it with the following code. This code is compatible with IE and ff. frm = window.parent.window .frames['uploadFrame'];

In fact, the frames collection is not hung on the document but under the window object.


Note that there are restrictions on modifying the pages in the frame in this way, that is It must be under the same domain, otherwise it cannot be accessed
If it is under the same domain, but the subdomain names are different, then add one sentence to the js and html files involved.
document.domain = xxx.com [Fill in your domain name here]
document.getElementById('iframeid').contentWindow.document.getElementById('someelementid');

Original address: http://www.52blogger.com/archives/516

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