Javascript-在JSP中定义变量
我有一个基于SpringWebModelViewController(MVC)框架的项目。SpringWebModelViewController(MVC)框架的版本是3.2.8,部署在WebLogic服务器版本12.1.2.0.0上 我的JSP中有这段代码Javascript-在JSP中定义变量,javascript,html,jsp,Javascript,Html,Jsp,我有一个基于SpringWebModelViewController(MVC)框架的项目。SpringWebModelViewController(MVC)框架的版本是3.2.8,部署在WebLogic服务器版本12.1.2.0.0上 我的JSP中有这段代码 <script src="${contextPath}/scripts/jquery.min.js" type="text/javascript"> var optionsEUCountriesArray = []; var
<script src="${contextPath}/scripts/jquery.min.js" type="text/javascript">
var optionsEUCountriesArray = [];
var optionsNonEUCountriesArray = [];
<c:forEach items="${countries}" var="country" varStatus="status">
var option${country.id} = new Option("${country.id}","${country.description}");
<c:choose>
<c:when test="${country.euMember}">
optionsArray.push(option${country.id});
</c:when>
<c:when test="${not country.euMember}">
optionsArray.push(option${country.id});
</c:when>
</c:choose>
</c:forEach>
</script>
<script src="${contextPath}/scripts/selectbox.js" type="text/javascript"></script>
您正在合并脚本。也许这会解决你的问题
<script src="${contextPath}/scripts/jquery.min.js" type="text/javascript"> </script>
<script>
var optionsEUCountriesArray = [];
var optionsNonEUCountriesArray = [];
<c:forEach items="${countries}" var="country" varStatus="status">
var option${country.id} = new Option("${country.id}","${country.description}");
<c:choose>
<c:when test="${country.euMember}">
optionsArray.push(option${country.id});
</c:when>
<c:when test="${not country.euMember}">
optionsArray.push(option${country.id});
</c:when>
</c:choose>
</c:forEach>
</script>
var期权EUCountriesArray=[];
var optionNoneuconCountriesArray=[];
var option${country.id}=新选项(${country.id},“${country.description}”);
optionArray.push(选项${country.id});
optionArray.push(选项${country.id});
您正在合并脚本。也许这会解决你的问题
<script src="${contextPath}/scripts/jquery.min.js" type="text/javascript"> </script>
<script>
var optionsEUCountriesArray = [];
var optionsNonEUCountriesArray = [];
<c:forEach items="${countries}" var="country" varStatus="status">
var option${country.id} = new Option("${country.id}","${country.description}");
<c:choose>
<c:when test="${country.euMember}">
optionsArray.push(option${country.id});
</c:when>
<c:when test="${not country.euMember}">
optionsArray.push(option${country.id});
</c:when>
</c:choose>
</c:forEach>
</script>
var期权EUCountriesArray=[];
var optionNoneuconCountriesArray=[];
var option${country.id}=新选项(${country.id},“${country.description}”);
optionArray.push(选项${country.id});
optionArray.push(选项${country.id});
调用您的selectbox.js后调用您的selectbox.js后