SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Enthusiast jitao's Avatar
    Join Date
    Feb 2003
    Location
    Shanghai
    Posts
    42
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question how to properly write content into frame?

    Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <HTML>
    <HEAD>
    <SCRIPT LANGUAGE="JavaScript">
    <!--
    function do_write(text2write)
    {
      window.frames["screen"].document.write(text2write);
    }
    //-->
    </SCRIPT>
    <TITLE> Testing Document </TITLE>
    
    </HEAD>
    <FRAMESET ROWS="*,40" COLS=",">
    	<FRAME SRC="screen.html" NAME="screen">
    	<FRAME SRC="writer.html" NAME="writer">
    </FRAMESET>
    <BODY onload='javascript: do_write("hello world!");'>
    
    </BODY>
    </HTML>
    I want to use javascript to change the content of a frame from the frameset page, but the above code does not work. urgently need your help. Thanks,
    Ji Tao

  2. #2
    Under Construction Poop_Shoot's Avatar
    Join Date
    Jul 2003
    Location
    Sacramento, CA
    Posts
    330
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <HTML>
    <HEAD>
    <SCRIPT LANGUAGE="JavaScript">
    <!--
    function do_write(text2write)
    {
      document.screen.document.write(text2write);
    }
    //-->
    </SCRIPT>
    <TITLE> Testing Document </TITLE>
    
    </HEAD>
    <FRAMESET ROWS="*,40" COLS=",">
    	<FRAME SRC="screen.html" NAME="screen">
    	<FRAME SRC="writer.html" NAME="writer">
    </FRAMESET>
    <BODY onload='do_write("hello world!" );'>
    
    </BODY>
    </HTML>

  3. #3
    SitePoint Enthusiast jitao's Avatar
    Join Date
    Feb 2003
    Location
    Shanghai
    Posts
    42
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    sorry, it does not work in IE 6. Have you tested it?


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •