Non so se ti servirà.... x IE 6.0
Uso i popup ma penso sia fattibile con degli iframes.
File : : test955.html
codice:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Untitled</title>
<script language="JavaScript" type="text/javascript">
<!--
var loadedFile;
var loadedRef;
function loadFile(aFileName) {
loadedFile = aFileName;
loadedRef = window.open('test955b.html',null,"height=0, width=0, menubar=no, toolbar=no,resizable=no,scrollbars=no" );
} // function loadFile(aFileName)
function play() {
//------------ Pour savoir sur quelle page on se trouve
// j'ai créé dans chaque page une fonction getPage
if (loadedRef.getPage() == 'a') {
loadedRef.a();
} else {
loadedRef.b();
}
}
//-->
</script>
</head>
<body onunload="loadedRef.window.close()">
Clica su uno dei 2 pulsanti e poi clicca XXXX
<input type="button" value="Carica file 1" onclick="loadFile('test955c.js')">
<input type="button" value="Carica file 2" onclick="loadFile('test955d.js')">
<input type="button" value="XXXX" onclick="play()">
</body>
</html>
File : test255b.html
codice:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Untitled</title>
</head>
<body onload="window.resizeTo(0,0);window.moveBy(-1000, -1000);document.getElementById('script1').src=window.opener.loadedFile">
<script language="JavaScript" id="script1" type="text/javascript" ></script>
</body>
</html>
File : test955c.js
codice:
function a() {
alert('page a');
}
function getPage() {
return 'a';
}
Fichier : test955d.js
codice:
function b() {
alert('page b');
}
function getPage() {
return 'b';
}