jsp引用外部js时的错误

1.检查js中的方法是否可行:将js中的方法copy到jsp页面中看是否可行,注意方法必须放在<script>...</script>之间

2.当引入时不能正常运行时可能会存在两种问题:(1)引入的路径不正确;(2)jsp页面和js页面编码方式不一致。

 

当项目需要引用相对路径时需要注明<%

String path = request.getContextPath();

String basePaht = getScheme()+"://"+request.getServiceName()+":"+request.getServerPort()+path+"/";

%>

posted @ 2014-05-06 10:13  绣⒎少爷  阅读(263)  评论(0编辑  收藏  举报