jsp代码中间插入JS代码的格式

就是在<%%>中间插入JS代码的格式 JSP代码运行在JS页面之前 有没有办法让jsp代码中间的JS代码先运行 例如 jsp页面中用 select count(1) from table where id='输入帐户'验证是否已有该账户 有则用JS弹出对话框 没有则跳出可以发网站 百度党自重

<script lanuage="javascript">function justiice(t){if (t>0){</p><p>alert("account is exsiting")}}else{'redirect the other page!'}</script><%int i=conn.executeQuery("select count(1) from table where id='输入帐户'");%><input type=button onclick=justiice('<%=i%>')><! But i want to tell you that the sql statement you can't insert into your current page, it may incur SQL injection,Be cautious!>
温馨提示:内容为网友见解,仅供参考
第1个回答  2013-04-20
不是这样做的,用ajax做吧,提示:用XMLHttpRequest
相似回答