ÈçºÎjspÖеÄÒ»¸ö°´Å¥ À´µ÷ÓÃjsp·½·¨ - Java / Java EE
È磺
<%!
public void p()
{
System.out.println("ssss");
}
%>
<input type="button" value="send" >ÎÒÏë¼Óonclick=<%p();%>
µ«ÊDz»ÐÐËü»áÔÚÒ³Ãæ¼ÓÔØʱµ÷Óà µã»÷ button ²»ºÃʹ
ÔÚ <head>±êÇ©ÖÐдJavaScript´úÂëÈë
<script language="javascript">
function test()
{
System.out.println("ssss");
}
</script>
<input type="button" value="send" onclick="return test()">
µ±È»²»ºÃʹÁË£¬ÄãÓÿͻ§¶ËµÄ´úÂëµ÷Ó÷þÎñÆ÷¶ËµÄ·½·¨Ê¹ÓÃÆÕͨµÄjspÊÇ×ö²»µ½µÄ£¬ÏñÂ¥ÉÏÄÇÑùʹÓÃjavascript°É
ºÃÏñ²»ÄÜ£¬ÒªÃ´¾ÍÏñһ¥дjavacriptº¯Êý.
function test()
{
System.out.println("ssss");
}
jsÊä³öÕâÊÇɶ,,µÚÒ»´Î¼û..
ÕâÊÇJavaScript£¿È·ÊµBH
jsÄܵ÷System.out.println???
Ïà¹ØÎÊ´ð£º
JSPÒ³ÃæÖÐÓжà¸öradio°´Å¥
JSPÒ³Ã潫²ÎÊýPOST¸øservlet
ÒªÇóÈçÏÂ;
1.Ñ¡ÔñÒ»¸öradio£¬µ÷ÓÃservlet servletÖиù¾Ý²ÎÊýµ÷ÓÃÆäËû½Ó¿Ú£¬³ý·ÇÑ¡ÖиÃradio²¢µã»÷JSPÖеÄʵР......
ÎÒJSPµÄÒ³ÃæÊÇ£º
<%@ page language="java" contentType="text/html; charset=gb2312"
%>
<script>
function Save(){
xmlHttp=GetXmlHttpObject()
if(xmlHttp==nul ......
ΪʲôHTMLÒÔ¼°Ò»Ð©ÆäËü±êÇ©»áÏÔʾһЩÌض¨±íÏÖÐÎʽÄØ£¿ÈçHTMLÖеĻ»ÐбêÇ©<BR/>ÔڵײãÊÇÔõÑùʵÏÖµÄÄØ£¿ÏÖʵµÄÔÀíÊÇʲôÄØ
È¥W3C¹Ù·½ÍøÕ¾ÉÏ£¬¿´¿´°É£¡ÎÒÏëÒ»¿´Äã¾ÍÃ÷°×ÁË
ÎҲºͱàÒëÔÀíÓйأ¬ä¯ÀÀÆ÷Àï¿É ......
ÔõôÑù½«id´«¹ýÈ¥°¡£¿£¿£¿ÊǼòµ¥µÄ´«¡£¡£¡£ÔÚµØÖ·À¸ÖÐдidºÅ
LZ ºÃÓÄĬ£¡²»ÖªµÀÄãµÄÒâ˼£¿
ÊÇÏë°ÑID ´«µ½ACTION ? ͨ¹ýURl id=?
²»¹»Ïêϸ ±ðÈ˲»ÖªµÀÔõÑù°ïÄã
../XXXXX.do?id=XXXX&id2=XXXXX
......