What is the onload event handler needed to get # assigned to parent variable? What I tried didn't work!
Code is from JS bible, page 127-8 with some minor alterations by me.
Parent Page (in part)
The page that needs an onload event handler: Taken from c1
The onload = bit didn't work. I don't want the next page in the frame to come up until the user clicks on goNext. When I click on goNext, nothing happens.
Thanks!
The Parent Page
page c1
page z1
page c2
page z2
Code is from JS bible, page 127-8 with some minor alterations by me.
Parent Page (in part)
Code:
<!-- start
function goNext() {
var currOffset = parseInt(parent.currTitle);
if (currOffset < 40) {
currOffset +=1;
parent.cryptogram.location.href = "http://www.tpgames.net/gaming/2/word/cipher/f/c/c" + currOffset + ".html";
parent.keycode.location.href = "http://www.tpgames.net/gaming/2/word/cipher/f/z/z" + currOffset + ".html";
} else {
alert("This is the last Cryptogram under this Image Theme.");
}
}
funtion goPrev() {
var currOffset = parseInt(parent.currTitle);
if (currOffset > 1) {
currOffset -= 1;
parent.cryptogram.location.href = "/gaming/2/word/cipher/f/c/c" + currOffset + ".html";
parent.keycode.location.href = "/gaming/2/word/cipher/f/z/z" + currOffset + ".html";
} else {
alert("This is the first Cryptogram under this Image Theme.");
}
}
// end -->
</script>
</head>
<body>
<div id="bgHolder">
</div>
<iframe name="cryptogram" frameborder="1" height="50" scrolling="auto" width="800"
src = "http://www.tpgames.net/gaming/2/word/cipher/f/c/c1.html">
</iframe>
<iframe name="keycode" frameborder="1" height="60" scrolling="auto" width="800"
src = "http://www.tpgames.net/gaming/2/word/cipher/f/z/z1.html">
</iframe>
<tr>
<td>
<a href="javascript:goPrev()">
<img src="http://www.tpgames.net/gaming/2/word/cipher/f/goprev.gif">
</a>
||
<a href="javascript:goNext()">
<img src="http://www.tpgames.net/gaming/2/word/cipher/f/gonext.gif">
</a>
Code:
<body onload="currTitle()"> <table> <tr><td class="tpmarble"> WMS KZLZECB RM YSPL RFC RMZQR. </table>
Thanks!
The Parent Page
page c1
page z1
page c2
page z2
Comment