ITeye博客

关于jsp代码和javascript的执行顺序

bepatient · 2011-02-06 20:25 · div+css+js · Web前端 · Markdown

<html>
<head>
<title></title>
</head>

<body>

<script>
	alert("test");
</script>
<%
	int i = 1;
	int j = 1;
	System.out.println("77777777");
	//System.out.print(1/(i-j));
%>
1231231231
</body>
<%System.out.println("99999999999");%>
<script>
	alert("test2");
</script>
</html>

 次页面执行效果:先打印出77777777和99999999999,再弹出窗口test和test2;

如果将注释去掉:先打印出77777777,然后页面报错:java.lang.ArithmeticException: / by zero

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。