📄 util.js
字号:
//
// Utility javascript functions
// @author Chau Nguyen
// @version 1.0
// @date 05/03/2002
/**
* set the cookie to the browser
*/
function setCookie (name, value, expires, path, domain, secure) {
document.cookie = name + "=" + escape(value) +
((expires) ? "; expires=" + expires : "") +
((path) ? "; path=" + path : "") +
((domain) ? "; domain=" + domain : "") +
((secure) ? "; secure" : "");
}
// Parse parameter out of a string.
function getParameter(string, parm, delim) {
// returns value of parm from string
if (string.length == 0) {
return '';
}
var sPos = string.indexOf(parm + "=");
if (sPos == -1) {
return '';
}
sPos = sPos + parm.length + 1;
var ePos = string.indexOf(delim, sPos);
if (ePos == -1) {
ePos = string.length;
}
return unescape(string.substring(sPos, ePos));
}
// Get parameter from query string passed to my page
function getPageParameter(parameterName, defaultValue) {
var s = self.location.search;
if ((s == null) || (s.length < 1)) {
return defaultValue;
}
return getParameter(s, parameterName, '&');
}
function getCookie(name) {
var cookie = " " + document.cookie;
var search = " " + name + "=";
var setStr = null;
var offset = 0;
var end = 0;
if (cookie.length > 0) {
offset = cookie.indexOf(search);
if (offset != -1) {
offset += search.length;
end = cookie.indexOf(";", offset)
if (end == -1) {
end = cookie.length;
}
setStr = unescape(cookie.substring(offset, end));
}
}
return(setStr);
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -