离线存储是在 HTML 5 中建立cache manifest
文件来实现 Web 应用的离线版本的。css
离线存储有这么几个好处:没有网络时能够浏览、加快资源的加载速度、减小服务器负载html
离线存储的相关配置在.appcache
文件中。
经过配置CACHE MANIFEST
,NETWORK
,FALLBACK
来控制须要被缓存的文件。
JavaScript 也暴露了applicationCache
API 让咱们手动进行缓存的刷新html5
HTML5 离线存储原理git
选择器
通配符: *
id 选择器: #app
class 选择器: .app
兄弟选择器: +
后代选择器: >
属性选择器: [type='input']
伪类选择器: ::beforegithub
能够继承的属性
font-size,
font-weight,
font-style,
font-family,
color,
text-indent,
text-align,
line-height,
word-spacing,
letter-spacing,
color,
direction,
text-transform,
cursor面试
首先仍是先分析
目的效果是这样的 'app_name' 变成 'appName'segmentfault
- 首先判断所给的字符串格式是否正确
- 将字符串经过方法 split 分切成一个数组
- 再根据数组的 reduce(累加) 方法,将后一个元素的首字母变大写以后合并在一块儿
function changeStr(str){ if(str.split('_').length==1)return; str.split('_').reduce((a,b)=>{ return a+b.substr(0,1).toUpperCase() + b.substr(1) }) }
面试题摘自 Github数组