I'm not sure if this is working at all...
I'm trying to get the iframe to display a different poem I've written each time the page is loaded or refreshed. Am I doing this right?![]()
Thank you for looking!!
(There are poems in the real text documents I have, but it makes the file-size smaller without them in there...)
Code:<html><body onload="ChangePoem()"> <div style="text-align: center"> <p style="color: blue">Message here<br /><br /></p> <table style="text-align: center; background-color: rgb(245, 225, 227);" border="1" cellpadding="5" width="100%"> <!-- Random Poem --><tr> <td width="72%"> <iframe id="Poem" src="Poem 1.txt" width="96%"></iframe> <script language="text/javascript"> var Poem(3); var Last=3; Poem[0]="Poem 1.txt"; Poem[1]="Poem 2.txt"; Poem[2]="Poem 3.txt"; function ChangePoem() { var ranNum = Math.floor(Math.random() * (lastPoem - startPoem)) + startPoem; document.getElementById ("Poem").location.href = Poem[ranNum]; } </script> </td></tr> </table></div> </body></html>



Reply With Quote

Bookmarks