Forum Moderators: open

Message Too Old, No Replies

Dynamic building frames

         

gert_gouw

11:48 am on Aug 13, 2002 (gmt 0)



<HTML>
<!--- WHY won't this work properly in Netscape (any version up to 7.0)
but it works in IE!
The code in the "onload" SCRIPT's are executed, but nothing is written
in the frames.
I DONT'T want to use the <FRAME SRC="###.htm"> clause, because the
pages will be dynamicly generated.
Post solution to this forum or <email to the address in profile>
--->

<SCRIPT FOR=frame1 EVENT=onload LANGUAGE="JavaScript">
top.frame1.document.write('This is frame 1');
</SCRIPT>

<SCRIPT FOR=frame2 EVENT=onload LANGUAGE="JavaScript">
top.frame2.document.write('This is frame 2');
</SCRIPT>

<SCRIPT FOR=frame3 EVENT=onload LANGUAGE="JavaScript">
top.frame3.document.write('This is frame 3');
</SCRIPT>

<FRAMESET COLS="15%,85%" FRAMEBORDER="yes">
<FRAME NAME="frame1" TITLE="frame1">
<FRAMESET ROWS="15%,85%" FRAMEBORDER="yes">
<FRAME NAME="frame2" TITLE="frame2">
<FRAME NAME="frame3" TITLE="frame3">
</FRAMESET>
</FRAMESET>
</HTML>

[edited by: tedster at 3:18 pm (utc) on Aug. 19, 2002]

rewboss

2:37 pm on Aug 13, 2002 (gmt 0)

10+ Year Member



Because Netscape browsers don't understand this business about for="..." and event="..."

If you want to dynamically create content in this way, it's far better and more reliable to use a server-side script.

gert_gouw

2:32 pm on Aug 19, 2002 (gmt 0)



Thnx for the reply, but what do you mean by server side scripting, by means of .ASP or PHP? You still have to build the frames on the client and not on the server. Or do you mean to create tempory .htm files for the frames and use these temp names in the frame definition on the client side?

tedster

3:32 pm on Aug 19, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Welcome to WebmasterWorld, gert_gouw. I'm pretty sure rewboss was pointing toward your second solution. Standard HTML (defined by the W3C [w3.org]) does not include "for" and "event" attributes. They're specific to Microsoft's Internet Explorer 4+, as you've discovered, and don't work cross browser. Reference O'Reilly [oreillynet.com]

Let me invite you to our Welcome thread [webmasterworld.com]. It will help you learn about the many functions this board offers, and also orient you to our Terms of Service - for example, the fact that we don't allow personal email or URLs within the posts. I know it's not a common rule on other forums, but it has helped us build an information-rich community here, with a low amount of promotional clutter.