[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Writing into frames ...



>My university restricts my homepage to exactly one file 

Sounds like a school mentality, very stupid!!
But I like your idea, so I tryed it and it works! WOW I love 
JavaScrit.

Bellow is the test file that I created, try it it should work. 
Just a few notes....

1)It seems like you need a SRC tag, so use SRC = "#". That should 
load the main page. This is not ideal since it causes unessasary 
stuff to be downloaded :( But what else can you do??
If you dont have a SRC tag then the frame has no properties..

2)Frame sync, you must make sure that the frames exist before you 
write to them. But this is extreemly easy with your 1 page method. 
See my DoFrames( ) function.

3)Reloads- This might be a problem,  when you reload then the SRC="#" 
is loaded and the DoFrames( ) is not called. I dont know if there is 
a way to fix this?

----------------------------------
<HTML>
<HEAD>
<TITLE>Single page frames</TITLE>

<script>

function DoFrames( )
{
   if(  self.TitleFrame == null  ||  self.IndexFrame == null )
   {
      setTimeout(  "DoFrames( )",  500  );
      return;
   }

   LoadTitleFrame( );
   LoadIndexFrame( );
}

function LoadTitleFrame( )
{
   self.TitleFrame.document.open( );
   self.TitleFrame.document.write(  "<font size=6>This is the index</font>"  ); 
   self.TitleFrame.document.close( );
}

function LoadIndexFrame( )
{
   self.IndexFrame.document.open( );
   self.IndexFrame.document.write(  "<body bgcolor=\"#000000\" text=\"#ffffff\">"  ); 
   self.IndexFrame.document.write(  "<strong>test</strong><br>"  ); 
   self.IndexFrame.document.write( "This works"  ); 
   self.IndexFrame.document.close( );
}

</script>
</HEAD>

<FRAMESET ROWS="55,*" onLoad="DoFrames()">
   <FRAME SRC="#"
      MARGINHEIGHT=3
      MARGINWIDTH=3
      NAME="TitleFrame"
      SCROLLING="No"
   >

   <FRAME SRC="#" 
      MARGINHEIGHT=3
      MARGINWIDTH=3
      NAME="IndexFrame"
      SCROLLING="auto"
   >
</FRAMESET>



<BODY>
<NOFRAME>

<a href="http://www.netscape.com";>
   These pages use frames and make use quite a bit of JavaScript.<br> So
   you need to get Netscape 2.0 or later!!! 
</a>

</NOFRAME>
</body>

</HTML>

+----------------------------------------------+---------------+
| Andre v.d. Merwe   ( andrev@aztec.co.za )    |  White River  |
+----------------------------------------------+  Mpumalanga   |
|      Zen Source Library Maintainer           |  South Africa |
|                                              +---------------+
|  http://http.tamu.edu:8000/~sdd2252/Docs/Zen/Zen.html        |
+--------------------------------------------------------------+
For PGP public key, send message with GET PGP KEY in the Subject
--------------------------------------------------------------------
For help about the list, please send a message to 'majordomo@obscure.org'
with the message body 'help'. To unsubscribe, send a message to
'majordomo@obscure.org' with the message body 'unsubscribe javascript'.
List archives and pointer to FAQ: http://www.obscure.org/javascript/