hyj1412's Blog

record, write and share.


  • Home

  • Tags

  • Categories

  • Archives

Cookie个数限制及大小

Posted on 2015-08-30 | Edited on 2019-04-09 | In web

##各浏览器之间对cookie的不同限制:

浏览器 IE6.0 IE7.0/8.0 opera FF Safari Chrome
cookie个数 每个域为20个 每个域为50个 每个域为30个 每个域为50个 没有个数限制 每个域为53个
cookie大小 4095个字节 4095个字节 4096个字节 4097个字节 4097个字节 4097个字节

总之,在进行页面cookie操作的时候,应该尽量保证cookie个数小于20个,总大小 小于4KB

优站收录

Posted on 2015-08-10 | Edited on 2019-04-09 | In 站点收录

32个赞的站点收录

  • VeryCloud–一站式云服务提供商,云主机、云分发、云DNS

  • VeryCDN–国内著名CDN服务商,推荐

  • Rambo’s Blog

  • 开源中国

  • Bootstrap中文网

  • Highcharts中文网

  • 智图–腾讯家的图片优化平台

  • 图标下载

  • WrapBootstrap–so many bootstrap themes

  • 待续。。。

移动web开发整理

Posted on 2015-08-10 | Edited on 2019-04-09 | In web , mobile

更新历史

  • 2015年8月10日 初稿

meta基础知识

H5页面窗口自动调整到设备宽度,并禁止用户缩放页面

1
<meta name="viewport" content="width=device-width,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />

忽略将页面中的数字识别为电话号码

1
<meta name="format-detection" content="telephone=no" />

忽略Android平台中对邮箱地址的识别

1
<meta name="format-detection" content="email=no" />

当网站添加到主屏幕快速启动方式,可隐藏地址栏,仅针对ios的safari

1
<meta name="apple-mobile-web-app-capable" content="yes" /> <!-- ios7.0版本以后,safari上已看不到效果 -->
Read more »

js判断移动设备

Posted on 2015-08-08 | Edited on 2019-04-09 | In js

js判断是否是移动端设备

1
2
3
4
5
6
7
8
9
10
11
12
13
/**
* 判断是否是移动设备
* 主要判断userAgent
*/
function is_mobile() {
var ua = navigator.userAgent.toLowerCase();
var is_android = ua.match(/android/i) ? true: false;
var is_blackberry = ua.match(/blackberry/i) ? true: false;
var is_ios = ua.match(/iphone|ipad|ipod/i) ? true: false;
var is_win = ua.match(/iemobile/i) ? true: false;
var is_mobile = is_android || is_blackberry || is_ios || is_win;
return is_mobile;
}

压缩css和js文件

Posted on 2015-08-06 | Edited on 2019-04-09 | In shell

1、下载最新的yuicompressor.jar

1
https://github.com/yui/yuicompressor/releases

2、运行脚本

1
2
3
4
5
6
7
8
9
10
11
12
13
#!/bin/bash
read -p "请输入您要压缩的文件所在的目录 : " dir
#if [ ! -n "$1" ] ;then
if [ ! -n "$dir" ] ;then
echo "请输入您要压缩的文件所在的目录";
exit;
fi
# 这里换成css即可
for i in `find $dir -name "*.js"`;
do
echo "compress $i"
java -jar /home/june/yuicompressor-2.4.8.jar --charset=utf8 -o $i $i --nomunge
done

原文出处:Blog By Blank

1…789…11

hyj1412

记录生活,书写心得,分享成果
51 posts
26 categories
48 tags
Creative Commons
© 2022 hyj1412 |
Creative Commons
Powered by Hexo v3.9.0
|
Theme – NexT.Muse v7.1.0