Click to See Complete Forum and Search --> : showing "access is denied" while running a script to do some action for another frame


stchong
11-25-2003, 01:58 PM
I am trying to add some text in a text area of a web page from another page by javascript:
this is what I do:
1. create a file called 1.htm
<html><head>
<title>New Page 1</title></head>
<frameset rows="175,*">
<frame name="header" scrolling="no" noresize src="2.htm" target="main">
<frame name="main" src="http://xxxxx.xxx/xxx.htm">
<noframes>..... </noframes>
</frameset>
</html>

and this is a content of 2.htm

<html><head>
<title>New Page 2</title></head>
<script language="JavaScript">
<!--
function b(){
window.top.main.document.coolsus.message.value+="asdasdasd";
}
//-->
</script>
<body>
<form>
<INPUT type=button name="aa" value="aa" onClick="b();">
</form>
</body></html>

=====================================
for the src of frame "main", if I put a simple web page that I do for test, it can run; but when I set the src to a certain web page in the internet that I want, it can not run, it always shows me the error message
"access is denied"

what is the problem??

please help me....

thank you......

AdamGundry
11-25-2003, 02:16 PM
Security restrictions built in to Javascript prevent you from modifying pages from other domains. You will need to find another way to solve your problem.

Adam

stchong
11-25-2003, 02:34 PM
Oh, I see... thank you...

so does anyone have any idea for making the action that I want?? I really confuse now..


Thank you all the same...