Am trying to follow these instructions, but it doesn't seem to be working. Everytime I click on the links on my page, I just get an error on page.
http://www.yourhtmlsource.com/javasc...ingtothewindow
Below is the code for the 'test' page I'm trying to get it working in... can anyone help me out?
<html>
<head>
<script type="text/javascript">
function details1()
{
var generator=window.open('','name','height=400,width=500');
generator.document.write('<html><head><title>Popup</title>');
generator.document.write('<link rel="stylesheet" href="style.css">');
generator.document.write('</head><body>');
generator.document.write('<p>Here are more details for the 1st menu item.</p>');
generator.document.write('<p><a href="javascript
:self.close()">
Close</a> the popup.</p>');
generator.document.write('</body></html>');
generator.document.close();
}
function details2()
{
var generator=window.open('','name','height=400,width=500');
generator.document.write('<html><head><title>Popup</title>');
generator.document.write('<link rel="stylesheet" href="style.css">');
generator.document.write('</head><body>');
generator.document.write('<p>Here are more details for the 2nd menu item.</p>');
generator.document.write('<p><a href="javascript
:self.close()">
Close</a> the popup.</p>');
generator.document.write('</body></html>');
generator.document.close();
}
</script>
</head>
<body>
<p><strong>Menu Item 1</strong></p>
<p>Here is a short description of the item</p>
<p><a href="javascript
:details1();">Click here for more details</a></p>
<p><strong>Menu Item 2 </strong></p>
<p>Here is a short description of the item</p>
<p><a href="javascript
:details2();">Click here for more details</a></p>
</body>
</html>