This topic has been archived. It cannot be replied.
-
工作学习 / IT技术讨论 / 请教:Javascript变量显示, thanks!var test='123';
use alert to pop up a message '123' not 'test', how to write the script.
it seems alert(test) doesn't work
-cloud2001(卷云溶月);
2003-4-8
{132}
(#1130025@0)
-
It should be ok.
-guestagain(guest again);
2003-4-8
(#1130033@0)
-
it works. 你怎么写的?
-bingle(bingle);
2003-4-8
(#1130047@0)
-
换个变量名试试看, 不要用test, 比如用 a
-tztz(tztz);
2003-4-8
(#1130050@0)
-
Should I declare the variable in <head>??
-cloud2001(卷云溶月);
2003-4-8
(#1130060@0)
-
Maybe my question is not clear. I want to use the variable in jsp.I don't want to use get or post method, just want to get parent window's fields' value through javascript variables, and use out.println() to display.
Maybe it's not a good way, any suggestions?
-cloud2001(卷云溶月);
2003-4-8
{199}
(#1130071@0)
-
可以用hidden input来传递。
-luoboyang(萝卜秧);
2003-4-8
(#1130080@0)
-
hidden field 肯定能做,但页面看来不整齐,debug也麻烦。
-bluegreysky(绿袖);
2003-4-8
(#1130118@0)
-
她不想用post, get嘛。
-luoboyang(萝卜秧);
2003-4-8
(#1130122@0)
-
我就是想说这个东东不是好东东
-bluegreysky(绿袖);
2003-4-8
(#1130147@0)
-
I don't think so.
-guestagain(guest again);
2003-4-8
(#1130161@0)
-
你把client side script 和server side script搞混了。
-guestagain(guest again);
2003-4-8
(#1130084@0)
-
I want to mix the clien/server side scripts together, should have some ways.
-cloud2001(卷云溶月);
2003-4-8
(#1130114@0)
-
I don't think so. why not tell us what you want and we can find out a solution.
-guestagain(guest again);
2003-4-8
(#1130127@0)
-
please see inside.Thanks.
-cloud2001(卷云溶月);
2003-4-8
{728}
(#1130178@0)
-
就象#1130084说的,你把client side script 和server side script搞混了。staff_name是jscript中的变量,是在Client端运行得到的,而out.println是JSP中的语句,在服务器端运行。
-bingle(bingle);
2003-4-9
(#1130744@0)
-
out.println("<option value=staff_id>staff_name</opotion>")shouldnt it be
out.println("<option value=" + staff_id + ">" + staff_name + "</opotion>")
-goodbaby(小宝);
2003-4-9
{96}
(#1130751@0)
-
Thanks, everyboday, good night!
-cloud2001(卷云溶月);
2003-4-8
(#1130115@0)
-
Try my code here, there may be many ways to do it, but this one works as you expect.
-xiaoxiao(笑笑);
2003-4-9
{1536}
(#1130727@0)
-
Thank you very much, it works! I didn't think about to use 'document.write'.
-cloud2001(卷云溶月);
2003-4-9
(#1130815@0)
-
'document.write' is a client side script, in that solution, it works, but no server side script used. so there is no reason to use a jsp file.
-guestagain(guest again);
2003-4-9
(#1130918@0)
-
a simple htm file can do it , why need jsp?
-guestagain(guest again);
2003-4-9
{702}
(#1130907@0)
-
I think cloud2001 is devloping some web application, please see #1130178, what's shown here is just an example, you are right jsp is not needed for this example, but that's what the user asked. :)
-xiaoxiao(笑笑);
2003-4-9
(#1130961@0)
-
your solution does not meet the requirement because no server side script is used to handle the data inputed at client side.
-guestagain(guest again);
2003-4-9
(#1131074@0)