document.body.clientWidth ==> BODY对象宽度
document.body.clientHeight ==> BODY对象高度
document.documentElement.clientWidth ==> 可见区域宽度
document.documentElement.clientHeight ==&...
JSON对象存储
JSON对象提供的parse和stringify将其他数据类型转化成字符串,再存储到storage中就可以了
操作的方式:
存:
var obj = {"name":"ergouzi","age":"16"}
localStorage.setItem("userInfo",JSON.stringify(obj));...
前言
难得有空,今天开始重新规范的学习一下node编程。但是引入模块我看到用 require的方式,再联想到咱们的ES6各种export 、export default。
阿西吧,头都大了....
头大完了,那我们坐下先理理他们的使用范围。
require: node 和 es6 都支持的引入export / import&n...
需求点击第三方登录-->打开新tab并控制tab大小-->新tab登录完成自动关闭-->通知旧tab刷新
难点一 如何通过js新建tab
<a class="3rdLogin" href="/a/b/c">click to login</a>
$(".3rdLogin").click(function...
代码如下:
var targetNode = document.getElementById('some-id');
// Options for the observer (which mutations to observe)
var config = { attributes: true, childList: true };
// C...
<script id="popupAdTmpl" type="text/template">
<style type="text/css">
#popupAd {
position: fixed;
z-index: 999;
left: 0;
top: 0;...
@runat 在油猴脚本可以设置值为 document-start , document-body , document-end 等,表示脚本在网页生命周期的注入点,但是在不同生命周期运行多个不同的事件呢?参考stackoverflow的答案:
// ==UserScript==
// @name _Show page start even...
查看npm的设置
npm config list
设置代理
npm config set proxy http://127.0.0.1:2020
修改 registry
npm config set registry https://registry.npmjs.org
带用户名和密码验...
安装nvm ,node版本管理工具。 项目用法和文档
brew install nvm
常用的指令
查看版本
nvm ls-remote #远程所有node版本
nvm ls #本地所有安装的node版本
安装
nvm install 版本 #如果版本写node,会安装最新版本的node并自动切换,如果填写...