(function() { var canvas = document.getElementById('quakeCanvas'); // Create our Planetary.js planet and set some initial values; // we use several custom plugins, defined at the bottom of the file var planet = planetaryjs.planet(); planet.loadPlugin(autocenter({extraHeight: -120})); planet.loadPlugin(autoscale({extraHeight: -120})); planet.loadPlugin(planetaryjs.plugins.earth({ topojson: { file: 'https://101.43.39.125/HexoFiles/js/planetaryjs/world-110m.json' }, oceans: { fill: '#001320' }, land: { fill: '#06304e' }, borders: { stroke: '#001320' } })); planet.loadPlugin(planetaryjs.plugins.pings()); planet.loadPlugin(planetaryjs.plugins.zoom({ scaleExtent: [50, 5000] })); planet.loadPlugin(planetaryjs.plugins.drag({ onDragStart: function() { this.plugins.autorotate.pause(); }, onDragEnd: function() { this.plugins.autorotate.resume(); } })); planet.loadPlugin(autorotate(5)); planet.projection.rotate([100, -10, 0]); planet.draw(canvas); // Plugin to resize the canvas to fill the window and to // automatically center the planet when the window size changes function autocenter(options) { options = options || {}; var needsCentering = false; var globe = null; var resize = function() { var width = window.outerWidth /2 + (options.extraWidth || 0); var height = window.outerHeight/2 + (options.extraHeight || 0); globe.canvas.width = width; globe.canvas.height = height; globe.projection.translate([width / 2, height / 2]); }; return function(planet) { globe = planet; planet.onInit(function() { needsCentering = true; d3.select(window).on('resize', function() { needsCentering = true; }); }); planet.onDraw(function() { if (needsCentering) { resize(); needsCentering = false; } }); }; }; // Plugin to automatically scale the planet's projection based // on the window size when the planet is initia
-多年互联网运维工作经验,曾负责过大规模集群架构自动化运维管理工作。 -擅长Web集群架构与自动化运维,曾负责国内某大型金融公司运维工作。 -devops项目经理兼DBA。 -开发过一套自动化运维平台(功能如下): 1)整合了各个公有云API,自主创建云主机。 2)ELK自动化收集日志功能。 3)Saltstack自动化运维统一配置管理工具。 4)Git、Jenkins自动化代码上线及自动化测试平台。 5)堡垒机,连接Linux、Windows平台及日志审计。 6)SQL执行及审批流程。 7)慢查询日志分析web界面。
除了可以访问固有的 process.env.HOME 得到主目录等,还添加了如下属性:
利用JS来控制页面控件的显示和隐藏有两种方法,两种方法分别利用HTML的style中的两个属性,两种方法的不同之处在于控件隐藏后是否还在页面上占空位。
注意 注释 的“抓取文件404报错”,“抓取js常规报错”,“抓取页面性能时间”,代码很好理解,将整个操作放在闭包内执行,以免污染外面。 这段代码必须放在head标签头部内,若头部有js外联,那该段代码必须放在js外联之上,若将这段代码放置在http://www.xxx.com/logservice.js,那代码如下:
利用localStorage储存js文件,只有在第一次访问该页面的时候加载js文件,以后在访问的时候加载本地localStorage执行
原文: https://stackoverflow.com/questions/33140342/how-to-load-svg-file-into-svgrenderer-in-three-js I'm trying to use SVGRenderer in three.js (http://threejs.org/examples/#svg_sandbox). The example shows you how to make an SVG element (a circle) on the
与其它语言当中的this不同的是,我们JS当中的this总是指向一个对象。而具体是指向哪一个对象,则要看其运行时是基于哪一个函数的执行环境所动态绑定的。
本文章中所有内容仅供学习交流,抓包内容、敏感网址、数据接口均已做脱敏处理,严禁用于商业用途和非法用途,否则由此产生的一切后果均与作者无关,若有侵权,请联系我立即删除!
经常使用的 JS 方法,今天记下,以便以后查询 /* 手机类型判断 */ var BrowserInfo = { userAgent: navigator.userAgent.toLowerCase() isAndroid: Boolean(navigator.userAgent.match(/android/ig)), isIphone: Boolean(navigator.userAgent.match(/iphone|ipod/ig)), isIpad: Boolean(navigator.userA
12.JS判断两个日期大小 适合 2012-09-09 与2012-9-9 两种格式的对比
this的值是在运行时确定的 JS中的this究竟代表什么,这是在程序运行时根据上下文环境确定,可以分为以下几种情况。 1. 全局作用域中的this 在全局作用域中,this指向window对象。 console.log(this);//指向window对象 this.x = 5//在全局作用域内创建一个x //与this.x = 5的等价情况: //var x = 5; //x = 5; 在全局作用域中执行var x=5,其实是为window对象创建一个属性x,并令其等于5。 若定义变量时不加var,
今天一个朋友问我一个问题,他想做一个win32的桌面应用程序,而且还希望程序能做出web页面那种漂亮的效果,可目前项目组的成员全是以前做前端的一批人,怎么办? 我想了一下,几乎毫不犹豫地推荐了node-webkit, 但又想起前段时间看到的atom-shell,于是也推荐了下atom-shell,随手写了个atom-shell的例子给他。 package.json { "name" : "pingdemo", "version" : "0.1.0", "main" : "main.j
目前比较靠谱的方案就是检测某一个特定的样式来判断。页面有多个css文件时我们怎么去对应特定样式呢?方法其实很多。
JSX 是一个看起来很像 XML 的 JavaScript 语法扩展。React 可以用来做简单的 JSX 句法转换。 为什么要使用 JSX? 你不需要为了 React 使用 JSX,可以直接使用纯粹的 JS。但我们更建议使用 JSX , 因为它能定义简洁且我们熟知的包含属性的树状结构语法。 对于非专职开发者(比如设计师)同样比较熟悉。 XML 有固定的标签开启和闭合。这能让复杂的树更易于阅读,优于方法调用和对象字面量的形式。 它没有修改 JavaScript 语义。 HTML标签 与 Rea
之前从其他博客哪里搬了一个樱花落叶效果。但是我本人不是很喜欢那个樱花,而且那个樱花效果太密集太大了。很影响阅读体验,可以说是一个负优化。我这个人要求比较高,自然是很不满意这个效果,所以,我把代码稍微的改动了一下,达成了现在的效果。
本次实验将使用Django 3.0 配合 dwebsocket websocket组件,实现一个网页版的SSH命令行工具,其支持 vim , 支持 ping等交互命令,唯一的一个小缺点是略卡,不知道是我电脑问题还是这个socket框架不稳定呢。
今天写的 Js 逆向之补环境,就可以理解是在 Js 环境下精进我们的 " 骗术 "
背景知识 【卡爷文章】CSS文件动态加载(续)—— 残酷的真相 浏览器 CSS/JS 加载能力测试表 css、js的相互阻塞 了解这些基础知识之后,我们再来谈谈怎么做 检测css是否加载出错 目前比较
大部分网站都会对关键参数进行加密,JS 逆向时,我们首要任务是定位参数具体的加密逻辑。
相信每一个前端er对于跨域这两个字都不会陌生,在实际项目中应用也是比较多的。但跨域方法的多种多样实在让人目不暇接。老规矩,碰到这种情况,就只能自己总结一篇博客,作为记录。
效果图: <html> <head> <title>对话框</title> <link rel="stylesheet" type="text/css" href="/modules/
在three.js场景中,有时会遇到场景模糊,纹理失真的现象,似乎three.js并没有用到纹理图片应有的分辨率。可以通过相关设置来解决这个问题。
【如果大家对程序员,web前端感兴趣,想要学习的,关注一下小编吧。加群:731771211。免费赠送web前端系统的学习资料!!前端学习必备公众号ID:mtbcxx】
https://mp.weixin.qq.com/s/4hQplDJ4xrV30ZkwE78QVQ
Node.js是由ECMAScript及Node 环境提供的一些附加API组成的,包括文件、网络、路径等等一些更加强大的 API。
必须是预览版Edge下载地址:https://www.microsoft.com/en-us/edge/business/download
一、部署JS代码(将以下代码保存为js文件,文件名:love.js,然后直接引入使用,点击页面任意位置就可以看到效果了)
原Js文件,使用方式将下面代码,作为js文件,上传到自己网站,然后在Wordpress的footer引入一下,即科获得左键爱心特效。
我司的APP是一个典型的混合开发APP,内嵌的都是前端页面,前端页面要做到和原生的效果相似,就避免不了调用一些原生的方法,jsBridge就是js和原生通信的桥梁,本文不讲概念性的东西,而是通过分析一下我司项目中的jsBridge源码,来从前端角度大概了解一下它是怎么实现的。
函数dmeo为经声明就可正常调用,执行函数demo时,先将1赋值给b,再将b的值赋值给a;虽然a、b是在函数作用域中,但由于b未经声明,所以下面在browser环境中输出的结果表明b 在 window 属性中,而 a 则不会出现在全局对象中;函数demo的声明是在全局作用域,所以它归window对象所有
首先是外部脚本和行内脚本,对于异步加载的脚本,会导致竞争状态,使得出现未定义的错。
js中的this指向十分重要,了解js中this指向是每一个学习js的人必学的知识点,今天没事,正好总结了js中this的常见用法,喜欢的可以看看:
1 网页简介:基于 HTML+CSS+JavaScript 制作七夕情人节表白网页、生日祝福、七夕告白、 求婚、浪漫爱情3D相册、炫酷代码 ,快来制作一款高端的表白网页送(他/她)浪漫的告白,制作修改简单,可自行更换背景音乐,文字和图片即可使用
最近在做一个项目过程中,发现了一个很严重的安全漏洞,这个漏洞是乌云平台(http://www.wooyun.org)报告出来的。 1,使用场景 我们很多时候要使用WebView来展示一个网页,现在很多应用为了做到服务端可控,很多结果页都是网页的,而不是本地实现,这样做有很多好处,比如界面的改变不需要重新发布新版本,直接在Server端修改就行了。用网页来展示界面,通常情况下都或多或少都与Java代码有交互,比如点击网页上面的一个按钮,我们需要知道这个按钮点击事件,或者我们要调用某个方法,让页面执行某种
代码如下: JS复制JS复制JS复制 <script type="text/javascript"> //屏蔽右键菜单 document.oncontextmenu = function (event){ if(window.event){ event = window.event; }try{ var the = event.srcElement; if (!((the.tagName == "INPUT" && the.type.toLowe
前些天发现了一个巨牛的人工智能学习网站,通俗易懂,风趣幽默,忍不住分享一下给大家。点击跳转到网站前言 – 床长人工智能教程正在上传…重新上传取消https://www.cbedai.net/gkbskc
使用threejs实现3D模型加载和显示。3D编程就像拍大片,几个关键东西如下所列:
JS 中的this关键字对于初学者来说是一个谜,对于经验丰富的开发人员来说则是一个永恒的难题。this 实际上是一个移动的目标,在代码执行过程中可能会发生变化,而没有任何明显的原因。首先,看一下this关键字在其他编程语言中是什么样子的。 以下是 JS 中的一个 Person 类:
我们知道使用js获取标签元素,需要页面加载完成以后再获取,我们通过给onload事件属性设置了一个函数来获取标签元素,而jquery提供了ready函数来解决这个问题,保证获取标签元素没有问题,它的速度比原生的 window.onload 更快。
JS是一门弱类型(松散型)的语言,这也就是说其天生就与众不同,独领风骚! 在讲解变量作用域之前,我们先来了解一下JS中的变量。JS中的变量与其它语言有很大的不同,由于JS变量拥有松散(不强制)的本质,从而决定了其只是一个在特定阶段保持特定类型值的名字。
什么是跨域? 概念:只要协议、域名、端口有任何一个不同,都被当作是不同的域。 URL 说明 是否允许通信 http://www.a.com/a.js http://www.a.com/b.js 同一域名下 允许 http://www.a.com/lab/a.js http://www.a.com/script/b.js 同一域名下不同文件夹 允许 http://www.a.com:8000/a.js htt
setTimeout()在js类中的使用方法 setTimeout (表达式,延时时间) setTimeout(表达式,交互时间) 延时时间/交互时间是以豪秒为单位的(1000ms=1s) setTimeout 在执行时,是在载入后延迟指定时间后,去执行一次表达式,仅执行一次 setTimeout 在执行时,它从载入后,每隔指定的时间就执行一次表达式 1,基本用法: 执行一段代码: var i=0; setTimeout("i+=1;alert(i)",1000); 执行一个函数: var i=0
Web Workers API 的 Worker 接口代表一个可以轻松创建的后台任务,正常情况下,需要引用一个js脚本文件,那么有没有可能直接使用而不用"加载"JS脚本呢? Worker 是什么 Web Workers API (https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API)的 Worker 接口代表一个可以轻松创建的后台任务,并可以将消息发送回其创建者。创建一个工作程序只要简单的调用Worker() 构造函数,并指定一个
看完这本书《3D Game Programing for Kids》之后,发现3D游戏的学习,也可以使用javascript来写的。
我们知道,当我们将JS代码脚本放到<head></head>标签之间时,这是的js代码加载要先于DOM加载,而我们往往会在JS代码脚本中写一些获取DOM元素的代码,而此时的DOM是不完整的, 所以我们通常的解决方法是将函数放入到window.onload里面去,window.load事件是网页加载完毕时会触发的一个事件,如果将我们的函数与之绑定,我们的函数也会在页面加载完毕之后执行. 如下代码: <html xmlns="http://www.w3.org/1999/xhtml"> <head> <
今天整理下我们常用的js跳转代码,常用的js跳转代码比如:js倒计时跳转代码、pc站跳转手机站代码、在原来的窗体中直接js跳转用、在新窗体中打开页面用、js直接跳转代码、js返回代码、head标签内加如下代码实现页面定时自动跳转代码、self.location方式实现页面跳转、top.location方式实现页面跳转,具体请看以下代码,希望对你有帮助。
版权声明:本文为博主原创文章,遵循 CC 4.0 by-sa 版权协议,转载请附上原文出处链接和本声明。
传送门 在 WEB 开发中,时常会用到 javascript 来获取当前页面的 url 网址信息,在这里是我的一些获取 url 信息的小总结。
领取专属 10元无门槛券
手把手带您无忧上云