Window and Frames | Sololearn: Learn to code for FREE!
+ 1

Window and Frames

Hello, I'm trying to figure out how to use frames in JavaScript. When I use Code Playground to call the upper and lower frame .htm that I saved on my desktop, I get a blank page. Whenever I open the saved link I get the desired outcome, but when I try to link the upper and lower frames to the parent frame I get nothing. Pls Help Ex. <!DOCTYPE html> <html> <head> <title>Ch.8 Ex-1 Mult. Frames</title> </head> <frameset row="50, *" id="topWindow"> <frame name="upperWindow" src="file:///Users/Stew/Desktop/Ch.8_Ex.1_upper.htm" /> <frame name="lowerWindow" src="file:///Users/Stew/Desktop/Ch.8_Ex.1_lower.htm" /> </frameset> </html> <!DOCTYPE html> <html> <head> <title>Ch.8_Ex.1_lower.htm</title> <script type="text/javascript"> function window_onload() { alert("The name of the lower frame's window object is " +; alert("The location of lowerWindow's parent is " + window.parent.location.href); } </script> </head> <body onload="window_onload()"> <p> Lower Frame </p> </body> </html>

20th Dec 2017, 10:06 PM
2 ответов
+ 4
This can happen for two reasons :) Your file is in a different place, try to put the file in the community folder, and then everything can work, secondly, your file will not work, because your document is local, try to upload your file to the hosting, I think everything will work for you: )
20th Dec 2017, 10:29 PM
James16 - avatar
James16, Thank you for your quick answer. My file is correctly located in my folder, so i don't think that's the problem. I am however getting three red error boxes on the line of each <frame> saying - "Unexpected characters in the frameset phase. Characters Ignored." I can't figure out why this is. Lastly, what would be the easiest way to upload my files to hosting?
21st Dec 2017, 1:42 AM