JSP代码:
<% String path = request.getContextPath(); String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; %>
页面标签:
<base href="<%=basePath %>"
这样,路径的代码script前面的../就可以去掉了。
<script src="script/windows.js"></script>