Here’s some code that goes in a frame that sits in a window with another frame called “GameScreen”. The point of my code is that clicking a button will fill the text area with the body HTML of the GameScreen frame. And it does- the first time you do so. After that, nothing happens when you click the button.
Actually, it seems that it will only even show the HTML of the page that initially loads (via the parent window) into the GameScreen frame, and nothing happens if I click the button after follwing any links in the GameScreen frame.
Any help as to what the problem is?
(For the curious, this is just a testbed for a more complicated project that will actually do something with the info I’m just grabbing and stuffing in the textbox right now. But what I want now is to be sure that I can surf along in the GameView frame, then use the “Grab Game Screen HTML” button whenever I want to to see the body HTML from the GameScreen frame.)
[CODE]
<html>
<head>
<title>title</title>
<script language=”javascript” type=”text/javascript”>
function GrabGamescreenHTML() {
showtext = window.parent.GameFrame.document.body.innerHTML
document.Grabby.ShowsGameScreenHTML.value = showtext;
}
</script>
</head>
<body>
<form name=”Grabby”>
<textarea name=”ShowsGameScreenHTML” cols=”80″ rows=”5″>
Game Screen HTML should show up here when you click “take screenshot”
</textarea>
</form>
<p><button name=”GrabIt” type=”button”>onClick=”GrabGamescreenHTML();”>Grab Game Screen HTML</button>
</body>
</html>