变量值从javascript传递把JSP
it1352
帮助1人
问题说明
我有以下情况
<select name="dropdown_Source" onchange="call()">
<% for (int i=0 ; i < a1.length; i ) { if (a1[i]==n ull) break; %>
<option value="<%=a1[i]%>">
<%=a1[i]%>
</option>
<% } %>
</select>
<script>
function call() {
var source = document.forms[0].dropdown_source.value;
// Now this 'source' value i have to pass to jsp function
<%
Admin a = new Admin(); //this is class defined
a.getResult(source); //but source is not resolved here
%>
}
</script>
我应该如何传入此来源
值JSP功能? a.getResult()
- 函数将返回下拉元素列表,并列出
我必须填入另一个 < option>
tag。
How this source
value should I pass in JSP function? a.getResult()
- function will return me list of dropdown elements and that list I have to populate in another <option>
tag.
正确答案
#1
你不能这样做。在JSP页面编译完成后,JavaScript在客户端执行,并以 response
的形式发送到浏览器。
You cannot do that. JavaScript executes on the client side after JSP page is already compiled and sent to the browser as response
.
这篇好文章是转载于:学新通技术网
- 版权申明: 本站部分内容来自互联网,仅供学习及演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,请提供相关证据及您的身份证明,我们将在收到邮件后48小时内删除。
- 本站站名: 学新通技术网
- 本文地址: /reply/detail/tanhcfkjja
同类精品
更多
-
YouTube API 不能在 iOS (iPhone/iPad) 工作,但在桌面浏览器工作正常?
it1352 07-30 -
iPhone,一张图像叠加到另一张图像上以创建要保存的新图像?(水印)
it1352 07-17 -
保持在后台运行的 iPhone 应用程序完全可操作
it1352 07-25 -
使用 iPhone 进行移动设备管理
it1352 07-23 -
在android同时打开手电筒和前置摄像头
it1352 09-28 -
扫描 NFC 标签时是否可以启动应用程序?
it1352 08-02 -
检查邮件是否发送成功
it1352 07-25 -
Android微调工具-删除当前选择
it1352 06-20 -
希伯来语的空格句子标记化错误
it1352 06-22 -
Android App 和三星 Galaxy S4 不兼容
it1352 07-20