日期:2014-05-16  浏览次数:20297 次

可以通过定义js函数,将jsp变量值作为参数传递给该函数
如:
<input type="button" onclick="validate("<%=str%>")">,然后在js里定义validate函数:

<script type="text/javascipt">

function validate(name)

{

    alert(name);//即将str的值在js里显示出来了

}

</script>