JS中怎么调用<%%>的值
示例代码一:
<% String usercode = request.getParameter("usercode");//用request得到 %> <script type="text/javascript"> function toGjzxt(){ var usercode = "<%=usercode %>";//获取usercode参数值 } </script>
示例代码二:
<% String path = request.getContextPath(); String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; %>
//注意在Script的标签里面拼接不加“+”号 <script type="text/javascript" src="<%= path %>/scripts/jquery-1.7.2.min.js"></script>
原创文章,作者:ItWorker,如若转载,请注明出处:https://blog.ytso.com/tech/pnotes/16835.html