¹ØÓÚjavascript´«ÖµµÄÎÊÌâ
²»Ì«Ã÷°×Õâ¸öÎÊÌâ,×Ô¼ºËæ±ãдÁ˸ö²âÊÔÒ³Ãæ:ÔÚsessionÖзÅÒ»¸öÖµ,ͨ¹ýjavascriptµÄcheck()º¯ÊýÈ¥±È½ÏÊäÈëµÄÖµÓësession´æµÄÖµÊÇ·ñÏàͬ,¸Ð¾õÉÏÓà <%=session.getAttribute("name")%>ÕâÑùÓ¦¸Ã¶ÔÁË,µ«ÊÇÒ³Ãæ¾ÍÊÇÖ±½ÓÌøת,ÓôÃÆ°¡,¸ßÊÖÖ¸µãÏÂ
<%@ page language="java" import="java.util.*" pageEncoding="GBK"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<%
session.setAttribute("name","zhangsan");
%>
<title>test </title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<!--
<link rel="stylesheet" type="text/css" href="styles.css">
-->
<script type="text/javascript">
function check(){
if(document.form1.name.value!= " <%=session.getAttribute("name")%>"){
alert("ok&quo
Ïà¹ØÎÊ´ð£º
ÎÒÔÚºǫ́ÓÃC#±àдASP.NETÒ³Ã棬ͬʱҪÓÃJAVASCRIPTÀ´¿ØÖÆÌáʾ´°¿Ú£¬Èç
Response.Write(" <script language=javascript>confirm('È·¶¨ÒªÉ¾³ýÂð£¿') </script>");
ÎÒÒªÓÃconfirm( ......
JScript code:
function isDigit(s)
{
var patrn=/^[0-9]{1,20}$/;
if (!patrn.exec(s)) return false
return true
}
Ϊʲô²»Êdz¤¶ÈСÓÚ20µÄÒÔÊý×Ö¿ªÍ·µÄ×Ö·û´®
¶øÊdz¤¶ÈСÓÚ20µÄÈ«ÓÉÊý×Ö×é³É
......
JScript code:
var a="aa";
function ff(){
a="c";
if(false)
{
var a;
}
}
ff();
alert(a);
ΪʲôÒÔÉÏЧ¹û² ......
ÎÒ½Ó´¥web²»¾Ã£¬html¡¢JavaScriptÇ°¶Îʱ¼ä²Å¿ªÊ¼¿´£¬ÏÖÔÚ»ù±¾ÉÏÁ˽âÁËҪѧϰÄÄЩ¼¼Êõ¡£
¾õµÃjava»ù´¡ÊÇÍõµÀ£¬jspºÍservletÊǹؼü¡££¨¶ÔÓÚ¸öÈËÀ´½²ExtÒ²ÊÇÒ»¸ö¿²£©
¸Õ¿ªÊ¼¸ù±¾²»ÖªµÀJavaScriptµÄʱºò£¬¾õµÃ ......