[thelist] Welcome to the "thelist" mailing list

yan zhihong yanzhihong at sz.tom.com
Wed Nov 16 04:13:32 CST 2005



I have 4 files to verify whether I can get file's content via frame.

1.open test.html.
2.  After  I input dirrerent file name in the "File Name" text box and click "Alter File" button,the right frame always display the correct content.
3.After click "Look source" button,I get the right content.
4.but,
    when I want to the new file content display once clicking the "Alter File" button,that is, I needn't  second clicking.
        but,
            failed.
5.so,need a help.thanks in advance.

test.html
    <HTML>
    <HEAD>
        <SCRIPT type="text/javascript">
        </SCRIPT>
        <NOSCRIPT>
        </NOSCRIPT>
    </HEAD>
    <FRAMESET cols="20%,80%" title="" >
            <frame src="click.html" name="testFrame" title="test..." >
            <FRAME src="source.html" name="sourceFrame" title="test" scrolling="yes">
            <NOFRAMES>
            </NOFRAMES>
    </FRAMESET>
    </HTML>





click.html:
    <html>
    <head>
        <script language="javascript">
             function getsource(s) {
                 top.sourceFrame.location=s;
                 //getsource1();
             }
             function getsource1() {
                 alert(top.sourceFrame.document.documentElement.innerText);
             }
        </script>
    </head>
    <body>
         <form>
             File Name:
             <input type="text" id="filename">
             <input type="button" onclick="getsource(filename.value)" value="Alter File""> 
            <input type="button" onclick="getsource1()" value="Look source"">
        </form>
    </body>
    </html>





source.html:
sssssssssssssssssssssssssss
a.html
aaaaaaaaaaaaaaaaaaaaaaaaaaaaa


More information about the thelist mailing list