hvilken error
HeyJeg har fundet følgende script og forsøgt at modificerer det lidt, så det passer til mit behov.
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<SCRIPT language="JavaScript">
function display_image(form) {
selection = form.imagename.value;
text = form.tekst.value;
PreView = window.open("", "Preview", "toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,copyhistory=0,width=200,height=255");
PreView.document.open();
PreView.document.write("<HTML><HEAD>");
PreView.document.write("<TITLE>Preview</TITLE>");
PreView.document.write("</HEAD><BODY BGCOLOR=FFFFFF TEXT=000000>");
PreView.document.write("<FORM><CENTER><B><FONT SIZE=+1>" +
selectionname + "</FONT></B><HR>");
PreView.document.write(text);
PreView.document.write("<IMG HSPACE=0 VSPACE=0 " +
"SRC='" + selection + "'>");
PreView.document.write("<HR><FORM><INPUT TYPE='button' VALUE='Close' " +
"onClick='window.close()'></FORM>");
PreView.document.write("</CENTER>");
PreView.document.write("</BODY></HTML>");
PreView.document.close();
}
</SCRIPT>
</head>
<body bgcolor="#FFFFFF" text="#000000">
<FORM>
<input type="hidden" name="tekst" value="sfgdfsfs">
<input type="hidden" name="imagename" value="http://www.javascriptkit.com/abstract.gif">
<input type="image" src="http://www.javascriptkit.com/abstract.gif" onClick="display_image(this.form)">
</FORM>
</body>
</html>
Der dukker godt nok en popup frem men uden billede og tekst plus en Error on page i browseren.
Er det eventuelt en enklere løsning end at lave den formbaseret?