从JSP向JavaScript传递值 [英] passing value to JavaScript from JSP
本文介绍了从JSP向JavaScript传递值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
<% if(empRecNum != null && !(empRecNum.equals("")))
{
empSelected=true;
}
boolean canModify = UTIL.hasSecurity("PFTMODFY") && empSelected;
%>
<script type="text/javascript">
function add(){
alert(canModify);
df('ADD');
}
</script>
我需要提醒JavaScript中的canModify
I need to alert the canModify in my JavaScript
推荐答案
我知道我使用的是这样的东西:
I know I use something like this:
<%
String s = "BOB";
%>
<script>
alert('<%= s %>');
</script>
通过'<%=%>'标记,您可以输入java变量的值.
The '<%= %>' tag lets you put in the value of the java variable.
这篇关于从JSP向JavaScript传递值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文