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

J

Jiong Feng

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>
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,901
Latest member
Noble71S45

Latest Threads

Top