|
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<script type="text/javascript" src="Script/Ajax.js"></script>
<link rel="stylesheet" href="chat.css" type="text/css" />
<title>Chat Login Page</title>
</head>
<body style="background:url('background.jpg');">
<script type="text/javascript">
function Loggedon_Response(response, action) {
var chatmessage = eval('(' + response + ')');
switch (chatmessage.MessageCode) {
case 0:
alert(chatmessage.Value);
break;
case 1:
eval('(' + chatmessage.Value + ')');
break;
}
}
function SendLoginRequest(username, password) {
if (username.toString() == "") {
alert("Username field is empty");
return;
}
if (password.toString() == "") {
alert("Password field is empty");
return;
}
ajax.SendRequest(Loggedon_Response, window.location.href + "?op=login&username=" + username + "&password=" + password, true);
}
</script>
<script type="text/javascript">
function GetUserName() {
return document.getElementById("txtUsername").value;
};
function GetPassword() {
return document.getElementById("txtPassword").value;
};
function btnLogin_Click() {
SendLoginRequest(GetUserName(), GetPassword());
};
</script>
<span>Login page. </span>
<div>
<span>
Username:</span>
<input id="txtUsername" type="text" />
<span>
Password:</span>
<input id="txtPassword" type="text" />
<input id="btnLogin" type="button" value="login" onclick="javascript:btnLogin_Click()" style="width:100px;" />
</div>
</body>
</html>
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.