Uncaught SyntaxError: Unexpected token .
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%
String code = "12345678910123456789105";//条形码内容
int wdith=100; //设置宽
int height=20; //设置高
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><title></title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script language="javascript">
<!--
NS4 = (document.layers) ? 1 : 0;
visble_property_prefix = (NS4) ? "document.layers." : "";
visble_property_suffix = (NS4) ? ".visibility" : ".style.display";
visble_property_true = (NS4) ? "show" : "block";
visble_property_false = (NS4) ? "hide" : "none";
visble_property_printview = visble_property_prefix + "viewpanel" + visble_property_suffix;
function nowprint() {
window.print();
}
function window.onbeforeprint() {
eval(visble_property_printview + " = \"" + visble_property_false + "\"");
}
function window.onafterprint() {
eval(visble_property_printview + " = \"" + visble_property_true + "\"");
}
//-->
</script>
</head>
<body topmargin="0px" leftmargin="0px" rightmargin="0px" bottommargin="0px">
<%
StringBuffer barCode = new StringBuffer();
barCode.append("<img src='");
barCode.append(request.getContextPath());
barCode.append("/CreateBarCode?code=");
barCode.append(code);
barCode.append("&barType=CODE128&checkCharacter=n&checkCharacterInText=n'>");
out.println(barCode.toString());
%>
<div id="viewpanel" align="center">
<input name="bequery" type="button" value="打 印" style="cursor:hand;" onclick="nowprint();">
</div>
<!--script>nowprint();</script-->
</body>
</html>
出错
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><title></title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script language="javascript">
<!--
NS4 = (document.layers) ? 1 : 0;
visble_property_prefix = (NS4) ? "document.layers." : "";
visble_property_suffix = (NS4) ? ".visibility" : ".style.display";
visble_property_true = (NS4) ? "show" : "block";
visble_property_false = (NS4) ? "hide" : "none";
visble_property_printview = visble_property_prefix + "viewpanel" + visble_property_suffix;
function nowprint() {
window.print();
}
function window.onbeforeprint() {-->访问刷新出错
eval(visble_property_printview + " = \"" + visble_property_false + "\"");
}
function window.onafterprint() {
eval(visble_property_printview + " = \"" + visble_property_true + "\"");
}
//-->
</script>
</head>
<body topmargin="0px" leftmargin="0px" rightmargin="0px" bottommargin="0px">
<img src='/ImageUpload/CreateBarCode?code=12345678910123456789105&barType=CODE128&checkCharacter=n&checkCharacterInText=n'>
<div id="viewpanel" align="center">
<input name="bequery" type="button" value="打 印" style="cursor:hand;" onclick="nowprint();">-->单击打印按钮时出错
</div>
<!--script>nowprint();</script-->
</body>
</html>
相关推荐
JS提示:Uncaught SyntaxError:Unexpected token ) 错误的解决方法
在JavaScript编程中,遇到"Uncaught SyntaxError: Unexpected token )"是一种常见的运行时错误,这通常发生在解析代码时遇到了不被预期的字符或语法结构。这个
Vue项目报错:Uncaught SyntaxError: Unexpected token
"Vue项目在引入第三方JS文件时遇到Uncaught SyntaxError: Unexpected token错误,问题出在文件路径处理上。解决方法是将第三方JS文件移动到/static/util
JS提示:Uncaught SyntaxError: Unexpected token ILLEGAL错误的解决方法
在JavaScript编程中,遇到"Uncaught SyntaxError: Unexpected token ILLEGAL"错误是一个常见的问题。这个错误通常发生在解析代码时,遇到无法识别的非法
vue-cli 打包后提交到线上出现 "Uncaught SyntaxError:Unexpected token" 报错
"本文主要探讨了使用vue-cli构建的项目在打包后上线时遇到的‘Uncaught SyntaxError: Unexpected token’错误,以及由此引发的两个具体问题:问题1是导航点击无法
Vue项目报错:Uncaught SyntaxError: Unexpected token <
在Vue项目开发过程中,开发者可能会遇到一种常见的错误:`Uncaught SyntaxError: Unexpected token <`。这个问题通常出现在尝试引入第三方JavaScript依赖时


