cfour

Results 21 issues of cfour

**What kind of change does this PR introduce? (bugfix, feature, docs update, improvement)** docs update **What is the current behavior? (You can also link to an open issue here)** svg-baker-runtime...

I have a *header.html* template, It is used on every page, and each page has some differences. This is easy to implement if I can pass some parameters in require...

我试了很多次,发现确实是有这个问题,没拆成 2 个字符串的时候会返回 401 的错误。 发送 api 请求的时候 `access_token` 的值不就还是一个完整的 token 字符串吗? 是什么原因导致这样的问题呢?

**Do you want to request a *feature* or report a *bug*?** feature **What is the current behavior?** import CSS can not get the string. ``` import cssString from './index.css'; console.log('cssString',...

一图胜千言! ![javascript 原型](http://www.mollypages.org/tutorials/jsobj.jpg) *图片来源 - [MollyPages.org](http://www.mollypages.org/tutorials/js.mp)* ### 推导 1. Javascript 的世界里面 **“函数是一等公民”** 2. 原型链的顶端是 `Object.prototype`,而它的原型是 `null` ```js Object.getPrototypeOf(Object.prototype) === null // true ``` 3. 所有函数对象(普通函数 + 构造函数)的原型都是 `Function.prototype` ```js Object.getPrototypeOf(String)...

使用 `Element.getBoundingClientRect()` 方法返回元素的大小及其相对于视口的位置,包含如下属性: > 返回值是一个 [DOMRect](https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIDOMClientRect) 对象,这个对象是由该元素的 `getClientRects()` 方法返回的一组矩形的集合, 即:是与该元素相关的 CSS 边框集合。 > DOMRect 对象包含了一组用于描述边框的只读属性: left、top、right 和 bottom,单位为像素。除了 width 和 height 外的属性都是相对于视口的左上角位置而言的。 1. `top`: 元素上边框距离视窗顶部的距离 2. `bottom`: 元素下边框距离视窗顶部的距离 3. `left`:...

- [内存管理](https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Memory_Management) --- ### 内存生命周期 不管什么程序语言,内存生命周期基本是一致的: 1. 分配你所需要的内存 2. 使用分配到的内存(读、写) 3. 不需要时将其释放 \ 归还 在所有语言中第一和第二部分都很清晰,最后一步在底层语言中很清晰,但是在像 JavaScript 等上层语言中,这一步是隐藏的、透明的。 ### 什么是内存泄漏? > 内存不再被需要(使用)但没有被释放(回收) 在 JavaScript 这门高级语言中,内存管理依赖于 JS 引擎的垃圾回收机制。 ### 什么是垃圾回收机制? > 跟踪内存的分配和使用,当分配的内存不再使用时,自动释放它。...

> 按照页面加载、切换、关闭三个动作讲解页面状态改变会触发的一些事件 ### 加载页面 1. 文档解析完成触发 `readystatechange` 事件,`document.readyState === 'interactive'`,接着立即触发 `DOMContentLoaded` 事件。 ``` js document.addEventListener('readystatechange', function (event) { console.log(document.readyState) // interactive }) ``` ``` js document.addEventListener('DOMContentLoaded', function (event) { console.log('DOM...

### 绑定事件的三种方式 1. html 内联绑定 `onclick` 属性 ```html ``` 2. js 内设置元素 `onclick` 属性 ```js element.onclick = function () { console.log(2) } ``` 3. 事件绑定规范方法 `EventTarget.addEventListener()` ```js element.addEventListener('click', function ()...

### 基础结构样式 ``` html ``` ``` css /* css */ .wrap { width: 100%; height: 100%; } ``` ### 五种实现方式 1. `position` + `transform` ```css .content { position: absolute; top:...