Home > Web Front-end > JS Tutorial > Discussion on the problem of ifame parent window calling child window under Chrome_javascript skills

Discussion on the problem of ifame parent window calling child window under Chrome_javascript skills

WBOY
Release: 2016-05-16 16:55:20
Original
1251 people have browsed it

A browser incompatibility issue encountered in the project:

It works fine under IE and Firefox to directly call the js function of the child window using the name of the child window in the parent window of the ifame frame page, but not under Chrome. Works well.

Copy code The code is as follows:





<br><body> <br><p>This page uses frames, but your browser does not support frames. </p> <br></body> <br>


In IE and Firefox you can write like this:
Copy code The code is as follows:

function changeMenu(menu_id){
header.window.changeMenu( menu_id);
}

or:
Copy code The code is as follows:

function changeMenu(menu_id){
frames[0].changeMenu(menu_id);
}

can be used,

in Chrome Only the second way of writing can be used, so when you need to consider the compatibility issues of multiple browsers, you should use the second way of writing.
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