location / {
try_files $uri $uri/ /index.html;
}
location / {
try_files $uri $uri/ /index.html;
}
document.body.scrollTop等属性可以获取页面滚动距离等,但是此类属性在xhtml标准网页或者更简单的说是带<!DOCTYPE ..>标签的页面里得到的结果是0,
所以一般为了兼容性都这样写 document.documentElement.scrollTop || document.body.scrollTop;以下document属性全部推荐这种写法.
网页可见区域宽: document.body.clientHeight;
网页可见区域高: document.body.clientHeight
网页可见区域宽: document.body.offsetWidth (包括边线的宽)
网页可见区域高: document.body.offsetHeight (包括边线的高)
网页正文全文宽: document.body.scrollWidth
网页正文全文高: document.body.scrollHeight
网页被卷去的高: document.body.scrollTop
网页被卷去的左: document.body.scrollLeft
网页正文部分上: window.screenTop
网页正文部分左: window.screenLeft
屏幕分辨率的高: window.screen.height
屏幕分辨率的宽: window.screen.width
屏幕可用工作区高度: window.screen.availHeight
屏幕可用工作区宽度: window.screen.availWidth
location / {
proxy_pass http://1xxxx:4037/;
root html;
index index.html index.php;
}
(\/\/.*$)|(\/\*(.|\s)*?\*\/)
if (process.env.NODE_ENV === 'development') {
axios.defaults.baseURL = 'http://线下';
} else {
axios.defaults.baseURL = 'http://线上api服务器';
}
<!--favicon-->
<link rel="apple-touch-icon" sizes="180x180" href="{{ asset('favicon/apple-touch-icon.png') }}">
<link rel="icon" type="image/png" sizes="32x32" href="{{ asset('favicon/favicon-32x32.png') }}">
<link rel="icon" type="image/png" sizes="16x16" href="{{ asset('favicon/favicon-16x16.png') }}">
<link rel="manifest" href="{{ asset('favicon/site.webmanifest') }}">
<link rel="mask-icon" href="{{ asset('favicon/safari-pinned-tab.svg') }}" color="#5bbad5">
<meta name="msapplication-TileColor" content="#00aba9">
<meta name="theme-color" content="#ffffff">
server{
listen 80;
server_name t1.misiyu.cn;
location / {
proxy_pass http://xxx;
root html;
index index.html index.php;
}
}
function setCookie(name, value) {
let Days = 30;
let exp = new Date();
exp.setTime(exp.getTime() + Days * 24 * 60 * 60 * 1000);
document.cookie = name + "=" + escape(value) + ";expires=" + exp.toGMTString();
}
function getCookie(name) {
let arr, reg = new RegExp("(^| )" + name + "=([^;]*)(;|$)");
if (!(arr = document.cookie.match(reg))) {
return null;
} else {
return unescape(arr[2]);
}
}
function delCookie(name) {
let exp = new Date();
exp.setTime(exp.getTime() - 1);
let cval = getCookie(name);
if (cval != null)
document.cookie = name + "=" + cval + ";expires=" + exp.toGMTString();
}
exports.setCookie = setCookie;
exports.getCookie = getCookie;
exports.delCookie = delCookie;
/**
* 替换字符串,可变长度
* @param cnt 待替换的内容
* @param strings 被替换的字符串
* @return 替换后的字符串
*/
public static String replaceTencentJson(String cnt, String... strings) {
for (String string : strings) {
cnt = cnt.replace(string, "");
}
return cnt;
}
// 当然,直接处理json前面的数据,那么使用如下代码更好:
// String substring = html.substring(html.indexOf("(") + 1, html.lastIndexOf(")"));
// helper,简单封装匹配函数
function matchAll(str, reg) {
let res = [];
let match;
while ((match = reg.exec(str))) {
res.push(match)
}
return res
}