首页 > 代码库 > 一句话概述代码的用途
一句话概述代码的用途
1. [代码][HTML]代码
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>无标题文档</title>
</head>
<body>
<h1>很大的标题</h1>
</body>
</html>
2. [代码][JavaScript]代码
function login() {
var pa = $(‘#userId‘).val(), pb = $(‘#passId‘).val();
var exp = new Date();
exp.setTime(exp.getTime() + (30*24*60*60*1000));
window.document.cookie = "username" + "=" + pa + "; expires=" + exp.toGMTString()+";path=/";
window.document.cookie = "password" + "=" + pb + "; expires=" + exp.toGMTString()+";path=/";
if (pa != ‘‘ && pb != ‘‘)
return true;
alert(‘帐号与密码必须要填,否则不让你登录‘);
return false;
}
function setFoucs(){
$(‘#userId‘).val(GetCookie("username"));
$(‘#passId‘).val(GetCookie("password"));
}
//cookie
function GetCookie (name)
{
var arg = name + "=";
var alen = arg.length;
var clen = window.document.cookie.length;
var i = 0;
while (i < clen)
{
var j = i + alen;
if (window.document.cookie.substring(i, j) == arg) return getCookieVal (j);
i = window.document.cookie.indexOf(" ", i) + 1;
if (i == 0)
break;
}
return null;
}
function getCookieVal (offset)
{
var endstr = window.document.cookie.indexOf (";", offset);
if (endstr == -1)
endstr = window.document.cookie.length;
return unescape(window.document.cookie.substring(offset, endstr));
}
3. [代码][HTML]代码
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>无标题文档</title>
</head>http://www.enterdesk.com/special/huangguantp/?
<body>皇冠图片
<h1>很大的标题</h1>
</body>
</html>
一句话概述代码的用途