Forum Moderators: open
<script>
function opennew {
newopened = window.open("","opened,"scrollbar=yes","toolbar=no","directories=no","menubar=no","width=450","height=250");
newopened.focus();
newopened.document.open();
newopened.document.write("<% = trim(request("q")) %>");
newopened.close();
}
</script>
<form>
<input type="button" onClick="opennew();" value="Open">
</form> The text opened in the window is based on a variable. The variable is what the user entered in a form - that part works fine. When I click on the link I get an OBJECT EXPECTED error.
Any ideas
cmatcme
PS :: This goes on a long list of failing javascript functions so it's probably to do with that!
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>Untitled</title>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
<script type="text/javascript">
function opennew() {
newopened = window.open("","opened","scrollbars=yes,width=450,height=250");
newopened.focus();
newopened.document.open();
newopened.document.write('<% = trim(request("q")) %>');
newopened.document.close();
}
</script>
</head>
<body>
<form action="">
<p>
<input type="button" onClick="opennew();" value="Open" />
</p>
</form>
</body>
</html>
(I edited out the property=no assignments, as they are assumed, though for security reasons not all browsers will respect status=no, any more.)