Iframe question -- need dummy css and js reference to make the page work.

Discussion in 'Javascript' started by Jiong Feng, Jan 11, 2004.

  1. Jiong Feng

    Jiong Feng Guest

    I have a strange problem. I have two files test3.htm and test4.htm, as
    following. they are both located on my webroot (to prevent cross domain
    security issue)

    test3.htm has an iframe referring to test4.htm

    It is fine if I do http://mymachine.site.com/test3.htm now.

    But if I remove either the css reference or the .js reference, I will get
    access error. Note, in test3.htm, the .css and .js do not exist on my
    website, but they do prevent the script error. Why is so strange?

    (I do not want to try any document.domain code on these pages because they
    are always together.And of course I do not like these dummy links to make my
    page work)
    Thanks
    Jiong

    // Test3.htm:
    <html DIR="LTR">
    <head>
    <link rel="stylesheet" type="text/css" href="/common/nonexist.css">
    <!--if I remove it, I will get error-->
    <script language='javascript' src='/common/nonexist.js'></script>
    <!--if I remove it, I will get error-->
    <script>
    function tt()
    {
    var framefields =
    document.frames("submitframe").document.getElementsByTagName("INPUT");
    framefields[0].value="456";
    }
    </script>
    </head>
    <body marginheight="0" topmargin="0">
    <iframe height=0 width=0 id="submitframe" SRC="test4.htm">
    </iframe>
    <div class="DOCUMENT">
    <form name="frmSurveyMain" action="survey.aspx" method="post"
    width="100%">
    <input type=button value="try" onClick="tt();">
    </form>
    </div>
    </body>
    </html>

    // Test4.htm:
    <html>
    <head/>
    <body>
    <form method="POST" action="survey.aspx" style="display:none">
    <INPUT TYPE="text" ID="ACTION" NAME="ACTION" VALUE='123'></INPUT>
    </form>
    </body>
    </html>
     
    Jiong Feng, Jan 11, 2004
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. tuxedo
    Replies:
    4
    Views:
    754
    Carl Prothman [MVP]
    Aug 18, 2003
  2. Replies:
    1
    Views:
    927
    Soren Kuula
    Jan 27, 2006
  3. dorayme
    Replies:
    3
    Views:
    428
    dorayme
    May 3, 2008
  4. Daedalous
    Replies:
    3
    Views:
    788
    Daedalous
    Jan 16, 2004
  5. Paul
    Replies:
    3
    Views:
    158
Loading...

Share This Page