如何在Java脚本变量中存储值? [英] how to store value in java script variable?

查看:68
本文介绍了如何在Java脚本变量中存储值?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了一个Java脚本文件,其中编写了html代码,ajax来调用servlet.
在Java Servlet中,我编写了用于select查询的代码,以便从数据库表中选择数据并将此值存储在结果集中.
我想将此结果集值存储到javascript变量中.
我如何存储它???????

i have created a one java script file in that i have written a html code ,ajax to call servlet .
in java servlet i have written a code for select query as to select data from database table and store this value in resultset
i want to store this resultset value in to javascript variable.
how i store it ???????

推荐答案

我会建议您使用"JSP"而不是"java脚本",因为Java脚本太少了.

由于Java和Java脚本之间没有关系,因此您不能通过Java脚本变量来存储对ResultSet的引用.
I''ll suggest you to use `JSP` rather than using `java script` because the scope of `java script` is too little.

As there is no relationship between `java` and `java script` therefore you can''t store the reference of `ResultSet` through a `java script` variable.


这篇关于如何在Java脚本变量中存储值?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆