请教高手 下面的代码为什么出错了?
问题出在哪了?希望能给出详细一点的代码...谢谢!!!
<%@ page language="java" import="java.util.*" pageEncoding="GBK"%>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">
<title>My JSP 'menu.jsp' starting page</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<!--
<link rel="stylesheet" type="text/css" href="styles.css">
--> </head>
<script type="text/javascript">
function show_what()
{
document.bgColor="BLUE";
return true; }
</script>
<body>
<html:link action="return show_what()" >用户信息</html:link>
</body>
</html>
问题出在哪了?希望能给出详细一点的代码...谢谢!!!
<%@ page language="java" import="java.util.*" pageEncoding="GBK"%>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">
<title>My JSP 'menu.jsp' starting page</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<!--
<link rel="stylesheet" type="text/css" href="styles.css">
--> </head>
<script type="text/javascript">
function show_what()
{
document.bgColor="BLUE";
return true; }
</script>
<body>
<html:link action="return show_what()" >用户信息</html:link>
</body>
</html>
function show_what()
{
document.bgColor="BLUE";
return true; }
</script>
<body>
<html:link action="return show_what()" >用户信息 </html:link>
</body>
把<html:link action="return show_what()" >用户信息 </html:link>换成<input type="button" value="用户信息" onclick="show_what()">可以运行出效果
但是<html:link action="return show_what()" >用户信息 </html:link>为什么不行呢?把action="return show_what()"换成onclick="return show_what()" 也不行...