当前位置:编程学习 > JAVA >>

js错误

<link href="<%=contextPath%>/style/DU_Core.css" rel="stylesheet" type="text/css" media="all" />  哪位大侠给小弟指导下 这个的错误,小弟初来乍到,看别人代码有点晕!!! --------------------编程问答-------------------- 要说有错的话,那就可能是<%=contextPath%>  这里没有contextPath这个变量的缘故吧! --------------------编程问答-------------------- 这是源码:
<link rel="shortcut icon" href="images/Href.ico" type="image/vnd.microsoft.icon">
<link rel="icon" href="images/Href.ico" type="image/vnd.microsoft.icon">
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link href="<%=contextPath%>/style/DU_Core.css" rel="stylesheet" type="text/css" media="all" />
<link href="<%=contextPath%>/style/layout.css" rel="stylesheet" type="text/css" media="screen" />
<script type="text/javascript">
var contextPath="<%=contextPath%>";
</script>
<script type="text/javascript" src="<%=contextPath%>/scripts/checkos.js"></script>
<script type="text/javascript" src="<%=contextPath%>/scripts/common.js"></script>

<script type="text/javascript" src="<%=contextPath%>/scripts/prototype/prototype.js"></script>
<script type="text/javascript" src="<%=contextPath%>/scripts/scriptaculous/scriptaculous.js"></script>
<script type="text/javascript" src="<%=contextPath%>/scripts/spry/widgets/accordion/SpryAccordion.js"></script>
<script type="text/javascript" src="<%=contextPath%>/scripts/regularExpressions.js"></script>
<script type="text/javascript" src="<%=contextPath%>/scripts/dTree.js"></script>
<script type="text/javascript" src="<%=contextPath%>/scripts/leftNavTree.js"></script>
<script type="text/javascript" src="<%=contextPath%>/scripts/chineseLetter.js"></script>
<script type='text/javascript' src="<%=contextPath%>/scripts/My97DatePicker/WdatePicker.js"></script>
<script type="text/javascript" for="document" event="onkeydown" src="<%=contextPath%>/scripts/onkeydown.js"></script>

是不是我把<%=contextPath%>改成contextPath就是对的啊? --------------------编程问答-------------------- 试试。 <%=request.getContextPath()%>  --------------------编程问答-------------------- 也不行 ,不过还是要谢谢你!!! --------------------编程问答--------------------

你<%=contextPath%>都没定义

<link href="<%=request.getContextPath()%>/style/DU_Core.css" rel="stylesheet" type="text/css" media="all" />
试试

或者就用相对路劲
<link href="/style/DU_Core.css" rel="stylesheet" type="text/css" media="all" />
--------------------编程问答-------------------- <%=contextPath%>
这个值放到session中,用的时候${contextPath}.

  --------------------编程问答-------------------- 都没好用,谢谢你们 --------------------编程问答-------------------- 会不会是路径的问题啊
补充:Java ,  Web 开发
CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,