index.html:
main.html:
As you can see, main.html is loaded in an invisible iframe in index.html. A function in main.html then calls a function in index.html which then prints the received string and shows an alert.
The problem is that right with the first run the thing hangs, probably in the echo() function. It prints the things it has to print (although on a new 'page'), gives the alert, and then just pretends to be busy.
Hmm... it now gives an interesting error in the JS Console right after it hangs:
Now, the question is: what are the stupid/boneheaded/forbidden/obvious things I'm clearly overlooking? ^_^
I've been testing this all in Firefox 1.5 RC1, BTW.
Off-topic: look at this:
Code:
<html>
<head>
<title>JS/HTML no-refresh interface test</title>
</head>
<body bgcolor="black" text="white" link="white" vlink="white" alink="green">
<iframe id="ifr" name="ifr" src="main.html" width="0" height="0" border="0"></iframe>
<p>
<script type="text/javascript">
function echo (str) {
document.write("string...");
document.write(str);
document.write("<br>done");
alert(str);
}
</script>
</p>
</body>
</html>
Code:
<script type="text/javascript">
var strings = new Array();
strings[0] = "First String";
strings[1] = "Second String";
window.parent.echo(strings[0]);
window.parent.echo(strings[1]);
</script>
As you can see, main.html is loaded in an invisible iframe in index.html. A function in main.html then calls a function in index.html which then prints the received string and shows an alert.
The problem is that right with the first run the thing hangs, probably in the echo() function. It prints the things it has to print (although on a new 'page'), gives the alert, and then just pretends to be busy.
Hmm... it now gives an interesting error in the JS Console right after it hangs:
It's as though the first document (index.html) has become unavailable.Error: window.parent has no properties
Now, the question is: what are the stupid/boneheaded/forbidden/obvious things I'm clearly overlooking? ^_^
I've been testing this all in Firefox 1.5 RC1, BTW.
Off-topic: look at this:
Error: Error in parsing value for property 'font'. Declaration dropped.
Source File: http://www.hardforum.com/editpost.php?do=editpost&p=1028525044
Line: 18