javascript µ÷Óà jspµÄ±äÁ¿
ÕÒÏÂÃæд·¨¡£
×¢Ò⣬¼Óµ¥ÒýºÅ£¬µÚ2¸ö°Ù·ÖºÅ֮ǰûÓпոñ£¬¶øÔÚjspÖе÷ÓõĻ°Òª¿Õ¸ñ¡£
You may be get some help from the code below.
<%
String str="str";
%>
<script>
function accessVar(){
var varStr='<%=str%>';
alert(varStr);// here will diplay 'str'
}
</script>
Ïà¹ØÎĵµ£º
1 JavaScriptÊý×é¼ò½é
JavaScriptÊý×éÊÇÒ»ÖÖ°üº¬ÒѱàÂëµÄÖµµÄ¸´ºÏÊý¾Ý¡£Êý×éÇø±ðÓÚ¹ØÁªÊý×飬¹ØÁªÊý×éÊǽ«ÖµºÍ×Ö·û´®¹ØÁªÔÚÒ»Æ𣬶øÊý×éÊǽ«ÖµºÍ·Ç¸ºÕûÊý¹ØÁªÔÚÒ»Æð¡£
Êý×éÊǶÔÏó(¿ÉÀûÓÃtypeofÔËËã·û)¡£
2   ......
javascript²Ù×÷Cookies·½·¨¼¯½õ
function setCookie(name,value)
{
var Days = 1; //´Ë cookie ½«±»±£´æ 1 Ìì
var exp = new Date(); //new Date("December 31, 9998");
exp.setTime(exp.getTime() + Days*24*60*60*1000);
document.cookie = name + ......
ÔÚPBÖÐʹÓÃJavaScript½Å±¾º¯Êý
ÔÚPBÖÐʹÓÃJavaScript½Å±¾º¯Êý
ÏÖÔÚÐí¶àµÄÐÅϢϵͳ¶¼ÊÇ»ùÓÚB/S°æ±¾£¬µ«PBдµÄÐÅϢϵͳÉú´æ¿Õ¼äÒ²±È½Ï´ó£¬ÍùÍùÊÇÒ»¸öÐÅϢϵͳ¼´ÓÐPB°æ±¾Ò²ÓÐB/S°æ±¾¡£ÐÅϢϵͳ»áÓÐÐí¶àµÄÒµÎñ¹æÔò£¬B/SÖÐÒµÎñ¹æÔòµÄ¼ì²éÔÚJavaScript½Å±¾ÖÐʵÏÖ£¬Èç¹ûÔÚPBÖÐÓÖʵÏÖÒ»´Î£¬·Ñʱ·ÑÁ¦²»Ëµ£¬
ÒµÎñ¹æÔò¸Ä±äÓÖÒªÖØб ......
javascript ÉèÖÃcookie×¢ÒâÊÂÏî
javascript ÉèÖÃcookie×¢ÒâÊÂÏî
ÔÚJavascript ÖУ¬cookie ¿ÉÒÔͨ¹ý document.cookie½øÐÐÉèÖ㬵±ÉèÖöà¸öcookieʱä¯ÀÀÆ÷»á×Ô¶¯°Ñ
ËüÃÇÓ÷ֺŸô¿ª¡£ÈçÏ£º
document.cookie = 'cookie1';
document.cookie ='cookie2';
alert (document.cookie) ;//Êä³ö cookie1 ; cookie2
µ«ÊÇÈç¹û°ÑµÚ ......
javascriptÐÞ¸ÄIMG±êÇ©µÄSRCʵÏÖÑéÖ¤Âëʱ,IEÕý³££¬»ðºüºÍgoogle³ö×´¿ö
1.µ±µã»÷ijһ°´Å¥µÄʱºò£¬°ÑͼƬÓòÖеÄͼƬ¸Ä±äÒ»ÏÂ
<img id="randimg" src="/servlet/CreateValidateNum" width="60" height="20" />
<span style="cursor:hand" onclick="reflush();return false; ......