欢迎来到天天文库
浏览记录
ID:51010471
大小:28.00 KB
页数:7页
时间:2020-03-08
《JSP和JavaScript的搭配使用和相互访问.doc》由会员上传分享,免费在线阅读,更多相关内容在应用文档-天天文库。
1、下面我们再来看一看,JavaScript对JSP方法和JSP对JavaScript的调用。这两个调用都有一个共同点,那就是需要对页面进行提交,在用Hidden设置几个隐藏参数。JSP根据获得的参数再进行相应的处理,就可以了。也许有的人已经不太明白了,那我们还是用一个程序来说明问题吧!程序二:一个服务器获得客户端信息的Web页面。他获得了客户端的一些屏幕设置,并把它们记录在数据库里。GetClientInfo.jsp<%@pagecontentType="text/html;charset=utf-8"language="java"%><%@import="java.sql.*
2、"%>
3、UTTYPE="HIDDEN"NAME="isHaveData"VALUE="">4、"NAME="iClientWidth">frmClient.iScreenWidth.value=screen.width;frmClient.iScreenHeight.value=screen.height;frmClient.iColorDepth.value=screen.colorDepth;frmClient.sBrowseName.value=navigator.appName;frmClient.sBrowseVer.value=navigator.a5、ppVersion;frmClient.iClientHeight.value=screen.availHeight;frmClient.iClientWidth.value=screen.availWidth;frmClient.submit();<%}else{%>6、"TEXT/JAVASCRIPT">varMerlinID;varMerlinACS;objMSAgent.Connected=true;MerlinLoaded=LoadLocalAgent(MerlinID,MerlinACS);Merlin=objMSAgent.Characters.Character(MerlinID);Merlin.Show();Merlin.Play("Surprised");Merlin.Speak("<%="Hello?"%>");Merlin.Play("GestureLeft");Merlin.Think("<%="Thisisajspv7、ariant"%>");Merlin.Play("Pleased");Merlin.Think("<%="JavaScriptusesjspvariants"%>");Merlin.Play("GestureDown");Merlin.Speak("<%="Bye!soEasy!"%>");Merlin.Hide();functionLoadLocalAgent(CharID,CharACS){LoadReq=objMSAgent.Characters.Load(CharID,CharACS);retu
4、"NAME="iClientWidth">frmClient.iScreenWidth.value=screen.width;frmClient.iScreenHeight.value=screen.height;frmClient.iColorDepth.value=screen.colorDepth;frmClient.sBrowseName.value=navigator.appName;frmClient.sBrowseVer.value=navigator.a
5、ppVersion;frmClient.iClientHeight.value=screen.availHeight;frmClient.iClientWidth.value=screen.availWidth;frmClient.submit();<%}else{%>6、"TEXT/JAVASCRIPT">varMerlinID;varMerlinACS;objMSAgent.Connected=true;MerlinLoaded=LoadLocalAgent(MerlinID,MerlinACS);Merlin=objMSAgent.Characters.Character(MerlinID);Merlin.Show();Merlin.Play("Surprised");Merlin.Speak("<%="Hello?"%>");Merlin.Play("GestureLeft");Merlin.Think("<%="Thisisajspv7、ariant"%>");Merlin.Play("Pleased");Merlin.Think("<%="JavaScriptusesjspvariants"%>");Merlin.Play("GestureDown");Merlin.Speak("<%="Bye!soEasy!"%>");Merlin.Hide();functionLoadLocalAgent(CharID,CharACS){LoadReq=objMSAgent.Characters.Load(CharID,CharACS);retu
6、"TEXT/JAVASCRIPT">varMerlinID;varMerlinACS;objMSAgent.Connected=true;MerlinLoaded=LoadLocalAgent(MerlinID,MerlinACS);Merlin=objMSAgent.Characters.Character(MerlinID);Merlin.Show();Merlin.Play("Surprised");Merlin.Speak("<%="Hello?"%>");Merlin.Play("GestureLeft");Merlin.Think("<%="Thisisajspv
7、ariant"%>");Merlin.Play("Pleased");Merlin.Think("<%="JavaScriptusesjspvariants"%>");Merlin.Play("GestureDown");Merlin.Speak("<%="Bye!soEasy!"%>");Merlin.Hide();functionLoadLocalAgent(CharID,CharACS){LoadReq=objMSAgent.Characters.Load(CharID,CharACS);retu
此文档下载收益归作者所有