Twinkie
Banned
- Messages
- 1,389
- Reaction score
- 12
- Points
- 0
I can't figure out how to access a frame from inside the frame page. In my real script, I am trying to change the title of the window to that of a certain frame. I tried self.framename like I was told, but no luck, can anybody with experience help?
This is a modified version from this TryIt Editor from w3schools, I find it much easier.
Edit:
Thank you all who tried to help, the answer was self.framename.document.title, but it did not work is because the file loaded was from a remote server, so access was denied to JavaScript. Took me a while. A more accurate version of my script is:
This got me an access denied error message. If anybody knows a way to do this, either with JavaScript or PHP, please tell me. Smart people don't use frames
HTML:
html>
<head>
<script type="text/javascript">
if ( document.title = ... .title ) alert("True");
</script>
</head>
<frameset cols="25%,50%,25%">
<frame name="framea" src="frame_a.htm">
<frame name="frameb" src="frame_b.htm">
<frame name="framec" src="frame_c.htm">
<noframes>
<body>Your browser does not handle frames!</body>
</noframes>
</frameset>
</html>
Edit:
Thank you all who tried to help, the answer was self.framename.document.title, but it did not work is because the file loaded was from a remote server, so access was denied to JavaScript. Took me a while. A more accurate version of my script is:
HTML:
html>
<head>
<script type="text/javascript">
if ( document.title = self.framea.document.title ) alert("True");
</script>
</head>
<frameset cols="25%,50%,25%">
<frame name="framea" src="http://yahoo.com">
<frame name="frameb" src="frame_b.htm">
<frame name="framec" src="frame_c.htm">
<noframes>
<body>Your browser does not handle frames!</body>
</noframes>
</frameset>
</html>
Last edited: