×

Javascript 29 篇文章

by Falcon

宇宙最好的语言你最好了解一下

  • js获取网页屏幕可见区域高度

    document.body.clientWidth ==> BODY对象宽度 document.body.clientHeight ==> BODY对象高度 document.documentElement.clientWidth ==> 可见区域宽度 document.documentElement.clientHeight ==&...

    2021-08-12 17:44 Falcon 阅读
  • localstorage 如何存储对象

    JSON对象存储 JSON对象提供的parse和stringify将其他数据类型转化成字符串,再存储到storage中就可以了 操作的方式: 存: var obj = {"name":"ergouzi","age":"16"} localStorage.setItem("userInfo",JSON.stringify(obj));...

    2021-07-25 18:12 Falcon 阅读
  • exports、module.exports和export、export default到底是咋回事

    前言 难得有空,今天开始重新规范的学习一下node编程。但是引入模块我看到用 require的方式,再联想到咱们的ES6各种export 、export default。 阿西吧,头都大了.... 头大完了,那我们坐下先理理他们的使用范围。 require: node 和 es6 都支持的引入export / import&n...

    2021-07-25 11:00 Falcon 阅读
  • 第三方登录弹窗效果

    需求点击第三方登录-->打开新tab并控制tab大小-->新tab登录完成自动关闭-->通知旧tab刷新 难点一 如何通过js新建tab <a class="3rdLogin" href="/a/b/c">click to login</a> $(".3rdLogin").click(function...

    2021-06-21 09:34 Falcon 阅读
  • 如何检测Dom发生修改

    代码如下: var targetNode = document.getElementById('some-id'); // Options for the observer (which mutations to observe) var config = { attributes: true, childList: true }; // C...

    2021-04-13 09:50 Falcon 阅读
  • dfp popup content in iframe

    <script id="popupAdTmpl" type="text/template"> <style type="text/css"> #popupAd { position: fixed; z-index: 999; left: 0; top: 0;...

    2021-03-25 16:14 Falcon 阅读
  • 油猴@runat在多个事件中使用的方法

    @runat 在油猴脚本可以设置值为 document-start , document-body , document-end 等,表示脚本在网页生命周期的注入点,但是在不同生命周期运行多个不同的事件呢?参考stackoverflow的答案: // ==UserScript== // @name _Show page start even...

    2021-03-07 03:17 Falcon 阅读
  • npm设置和取消代理的方法

    查看npm的设置 npm config list   设置代理 npm config set proxy http://127.0.0.1:2020 修改 registry npm config set registry https://registry.npmjs.org   带用户名和密码验...

    2021-03-02 04:37 Falcon 阅读
  • nvm笔记: node版本管理工具

    安装nvm ,node版本管理工具。 项目用法和文档 brew install nvm 常用的指令 查看版本 nvm ls-remote #远程所有node版本 nvm ls #本地所有安装的node版本 安装 nvm install 版本 #如果版本写node,会安装最新版本的node并自动切换,如果填写...

    2020-09-15 11:27 Falcon 阅读