Hi,
I am trying to create an embedded <script>
containing a function called "showForm()"
that displays the contents of a file called "form.htm" within the main browswer window.
This is what I need to do:
Display the form.htm file in the browser window that was used to open the cover.htm file. (hint: use the "opener" keyword to reference the main browser window, and the location.href property to specify the document to be displayed in that window.)
Close the current window.
I am having a hard time figuring out exactly what each part is and what it all means and I also don't really understand how to write it. I get that I am trying to open new content("form.htm") within the existing browser window "cwj.htm" and then close it out but I don't understand how to write it. Any help is appreciated. Thanks!
Here is the code I have come up with. See the <script>
tag:
<head>
<title>Subscription</title>
<link href="cover.css" rel="stylesheet" type="text/css" />
<script type="text/javascript">
function showForm() {
<!--window.open("form.htm","opener","");
window.close(); -->
<!--window.open("location.href"); -->
document.write(location.href);
window.open("form.htm","opener","");
window.close();
}
</script>
</head>