Home > front end >  The inside of the new beginner, explanation. Reset each click, will appear empty data, but each time
The inside of the new beginner, explanation. Reset each click, will appear empty data, but each time

Time:09-22

<% @ page language="Java" pageEncoding="utf-8" % & gt;
<%
String path=request.getContextPath();
String=basePath request. GetScheme () + "://" + request. GetServerName () + ":" + request. GetServerPort () + + "/" path;
%>

The login. Jsp
<meta HTTP - equiv="pragma" content="no - cache" & gt;
<meta HTTP - equiv="cache-control" content="no - cache" & gt;
<meta HTTP - equiv="expires" content="0" & gt;
<meta HTTP - equiv="keywords" content="keyword1, keyword2, keyword3 & gt;"
<meta HTTP - equiv="description" content="This is my page" & gt;

<link rel="stylesheet" type="text/CSS" href="https://bbs.csdn.net/topics//css/style.css" & gt;
<style type="text/css">
The body
{
Margin - left: 0 px;
Background - image: url (& lt; % %=path & gt;/img/BHJ. JPG);
}
The style2} {color: # 990000
The input2
{
font-size: 12px;
Border: # 3 px double A8D0EE;
Color: # 344898;
}
. Submit1
{
Border: 3 px c9c double # 416;
height: 22px;
Width: 45 px;
Background - color: # F2F2F2;
font-size: 12px;
Padding - top: 1 px;
Background - image: url (bt. GIF);
cursor: hand;
}
. STYLE12 {the font-family: Georgia, "Times New Roman", Times, serif}
Bd6. STYLE13 {color: # 316; }
. STYLE15 {color: # fdsere; font-size: 9pt; }
</style>



<script language="javascript" & gt;//scripting language is javascript
The function check1 ()
{
If (document.ThisForm.userName.valuehttps://bbs.csdn.net/topics/=="")//if the value of the userName is empty, so
{
Alert (" please enter the user name ");//information to pop up a warning window, please enter the user name
Document. ThisForm. UserName. Focus ();//then the focus or the cursor will locate in the empty text box
return false;//returns a failure
}
If (document.ThisForm.userPw.valuehttps://bbs.csdn.net/topics/=="")//if the value is empty, userPw so
{
Alert (" please enter the password ");
Document. ThisForm. UserPw. Focus ();
return false;
}
Document. The getElementById (" indicator ".) style. The display="block";//get the current page id for the indicator label inside, change the label style, make its eyeful show
LoginService. Login (document. ThisForm. UserName. The value, the document. The ThisForm. UserPw) value, 0, the callback);//callback function, when the login after completion of execution, the login will callback callback method
}

The function callback (data)//callback function
{
Document. The getElementById (" indicator ".) style. The display="none";//get the current page id for the indicator label inside, change the style of the label, so that they don't show
If (datahttps://bbs.csdn.net/topics/=="no")
{
Alert (" user name or password error ");

}
If (datahttps://bbs.csdn.net/topics/=="yes")
{
Alert (" through validation, system login success ");
Window. The location. Href="https://bbs.csdn.net/topics//loginSuccess.jsp";//jump to loginSuccess. The JSP page
}
}
</script>

<body>


<body>












The campus second-hand book trading platform & lt;/div>

















Compact & amp; nbsp; & nbsp; & nbsp; Code:

  • Related