- document.body为null的问题
雾江流
问题解决JSjavascriptdocumentnull
document.body为null的问题今天在head标签里写is代码时,给body添加标签时,发现报错,最后发现是document.bodyisnull的原因解决方法:原因很简单,是因为我们在body标签前就加载了或写的js代码,此时还没有body元素问题的解决办法把调用到document.body的JS代码移到body标签之中用onload属性让body先加载再执行JS代码window.on
- React 测试库 - API
liangshanbo1215
TestingLibraryreact.js前端前端框架单元测试
ReactTestingLibrary也会重新导出DOMTestingLibrary中的所有内容如以下方法:renderfunctionrender(ui:React.ReactElement,options?:{/*Youwon'toftenusethis,expandbelowfordocsonoptions*/},):RenderResult渲染到到document.body的容器中。imp
- javascript的Bom
ggggyyyyy0928
javascript开发语言ecmascript
一、Bom的概念概念:浏览器模型,提供了与浏览器窗口交互的对象,核心对象是window二、window对象的常见事件1、页面加载事件当文档内容加载完执行该事件window.onload=function(){}2.调整窗口大小事件window.onresize=function(){}三、定时器window可以省略,毫秒数默认为01.setTimeout延时器:延迟多少时间执行vartimer1=
- 浏览器常用的输出方式
Leonard被注册了
console.xxxconsole.log()leta=10;console.log(a);//10console.dir():输出一个对象的详细键值对信息console.dir(document.body);console.table():把一个多维JSON数组在控制台按照表格的方式呈现出来letb=[{id:1,name:'张三'},{id:2,name:'李四'}]console.tabl
- 前端一键复制到剪贴板,带格式复制
NJR10byh
笔记前端javascripthtml
此一键复制可支持换行符,也可支持加粗等字体样式//复制(id为待复制内容的父类div的id)Copy(){this.selectElementContents(document.getElementById("CopyContent"));},//js一键复制selectElementContents(el){varbody=document.body,range,sel;if(document.
- Vue全局添加水印
灰海
vue.jsjavascript前端水印
首先创建一个js文件(shuiyin.js)//定义水印函数constaddWatermark=({container=document.body,//水印添加到的容器,默认为bodywidth="200px",//水印canvas的宽度height="100px",//水印canvas的高度textAlign="center",//水印文字的对齐方式textBaseline="middle",/
- 定时器
真的吗_a951
定时器setInterval(函数,毫秒);重复执行clearIntrval(setInterval(函数,毫秒))停止body{varBtn1=document.getElementsByTagName('input');varoBody=document.body;vartimer=null;varArr=['img/3.jpg','img/4.jpg','img/bg.jpg'];varnu
- 在js代码中为什么注释不了`<body> ... </body>`
pacong
javascript前端开发语言
在js代码中为什么注释不了...如下:这一行console.log(bodyEle);//...Document//1.获取body元素varbodyEle=document.body;console.log(bodyEle);//...console.dir(bodyEle);//2.获取html元素varhtmlEle=document.html;varhtmlEle=document.doc
- Sprite
Codifier
Spritebody{margin:0;overflow:hidden;}init();functioninit(){//showFPSletstats=initStats();//resizewindow.addEventListener('resize',onResize,false);letscene=newTHREE.Scene();letcamera=newTHREE.Perspecti
- vue使用echarts窗口自适应
~倩
jsvue.js
1.使用window.onresizevarmyChart=echarts.init(document.getElementById('myChart'));window.onresize=()=>{myChart.resize()}优点:可以根据窗口大小实现自适应缺点:window.onresize是绑定到window上的,切换vue页面时监听依然存在其他页面有window.onresize事件
- 浏览窗口大小变化,页面刷新
~牧马~
案例vue监听页面重新加载
vuemounted(){window.onresize=()=>{//执行重新刷新布局的操作this.$router.go()//重新页面加载}}htmlwindow.addEventListener('resize',function(){location.reload();//重载页面});
- JavaScript实现右键菜单
likepoems
前端三剑客javascript
1、代码实现window.onload=function(){(function(){//自定义右键菜单内容并插入到body最后一个节点前letdom=`蓝猫图床个人云盘书籍阅读接口文档`;letrightMenuDiv=document.createElement("div");rightMenuDiv.id="rightMenu";letbody=document.body;rightMenu
- vue中使用 canvas给页面添加水印
不能懒鸭
vue2.0javascriptvue.jsjavascript前端
封装公共添加水印的方法://utils/watermark.js/**入参:@text:传入水印需要展示的文本;@renderDom:要给哪个元素加水印,默认body;*/varwatermark={}varsetWatermark=function(text,renderDom=document.body){varid='1.23345566.3333344';if(document.getEl
- JavaScript DOM属性和方法之event事件对象
知数SEO
JavaScriptjavascript开发语言ecmascript
event对象代表事件的状态,比如事件在其中发生的元素,键盘按键的状态、鼠标的位置、鼠标按钮的状态,事件通常与函数结合使用,函数不会在事件发生前被执行,只有当事件被触发的时候才会执行函数。一、句柄事件1、onclick事件2、onchange事件3、onresize事件4、onblur和onfocus事件5、ommouseover和onmouseout事件6、onsubmit事件二、鼠标键盘属性1
- JS基础学习:轮播图完善/offset系列/图片跟随鼠标
Merbng
案例:图片跟随鼠标飞img{position:absolute;}document.onmousemove=function(e){my$('im').style.left=e.clientX+"px";my$('im').style.top=e.clientY+"px";};直接通过document获取元素啊娃娃//获取的是元素---标签console.log(document.body);//
- Angularjs 动态获取屏幕宽度
壹只很拽的猫
我是写在directivewindow.onresize=function(){$scope.$apply(function(){console.log("document.body.clientWidth",document.body.clientWidth);})};参考文档:angular怎么监听屏幕宽度改变angularjs中如何实现页面自适应?这个看起来能实现但是我没整明白
- 【JS】事件汇总(方便查找)
一颗不甘坠落的流星
JavaScript笔记javascript开发语言事件
文章目录一、鼠标事件二、键盘事件2.1、按下键盘键(keydown)2.2、抬起键盘键(keyup)2.3、按下有效键(keypress)2.4、常见键盘码(了解)三、焦点事件3.1、聚焦(focus)3.2、失焦(blur)3.3、扩展(focusin、focusout)四、加载事件4.1、加载完成(onload)4.2、加载失败(onerror)4.3、窗口变化(onresize)一、鼠标事件
- 关于成品项目分辨率适配解决方案
阳光先做
javascript开发语言react.js前端
最近接手一个项目,开发马上完成,客户突然提出产品的分辨率适配不太友好;......领导一声令下,改吧怎么改?量太大,项目用的react+antdv+umi,react页面没有800个也有500个了,一个一个页面改,不太现实,耗时太久,决定找新的其他方案.在网上找了一些文章,决定用css3transfrom+jswindow.onresize剑走偏锋做适配gitee地址,这是封装react的组件,v
- 12-函数节流
仰望_IT
1.什么是函数节流[throttle]?函数节流也是优化高频率执行js代码的一种手段可以减少高频调用函数的执行次数2.函数节流作用减少代码执行次数,提升网页性能3.函数节流应用场景oninput/onmousemove/onscroll/onresize等事件4.函数节流和函数防抖区别函数节流是减少连续的高频操作函数执行次数(例如连续调用10次,可能只执行3-4次)函数防抖是让连续的高频操作时函数
- 4.qq音乐练习3 进度条
wudimingwo
step1更新alltime功能pro.js//进度条模块(function($,root){//渲染总时间根据durationfunctionrenderalltime(time){$body=$(document.body);time=format(time);$body.find('.all-time').html(time);}//转换时间格式functionformat(time){va
- vue3获取屏幕当前宽度
爱学习的小康
前端javascripthtml
constscreenWidth=ref(document.body.clientWidth);window.onresize=()=>{//屏幕尺寸变化就重新赋值return(()=>{screenWidth.value=document.body.clientWidth})()}
- javascript获取元素
ANJUN_95da
JS获取DOM元素的方法(9种)通过ID获取(getElementById)通过name属性(getElementsByName)通过标签名(getElementsByTagName)通过类名(getElementsByClassName)获取html的方法(document.documentElement)获取body的方法(document.body)获取title的方法(document.t
- mui 区域滚动scroll中有input输入框时,软键盘弹出收回后滚动区域正常显示的代码
一个小憨憨
//获取默认界面高度varoriginalHeight=document.documentElement.clientHeight||document.body.clientHeight;window.onresize=function(){//获取当前界面高度varresizeHeight=document.documentElement.clientHeight||document.body.
- js中Document的常用属性和方法
小亮编码
javascript开发语言ecmascript
Document对象是HTML文档的根节点,它具有许多常用的属性和方法,如下所示:属性:document.documentElement:返回文档的根元素(即标签)document.head:返回文档的元素document.body:返回文档的元素document.title:获取或设置文档的标题document.URL:获取文档的URLdocument.domain:获取或设置文档的域名docu
- 函数防抖/节流
9adaf1f4d739
1.什么是函数节流(throttle)概念:限制一个函数在一定时间内只能执行一次举个栗子:做火车或地铁时,过安检的时候,在一定时间内(10秒),只允许一个乘客通过安检口,以配合安检人员完成安检工作.2.什么是函数节流前端开发过程中,有一些事件或函数,会被频繁的触发(短时间内多次触发),例如:onresize,scroll,mousemove,mousehover等,这些事件的触发频率很高,不做限制
- vue 弹出框自适应宽度
孤独白鲸
vueJSvue.jselementuijavascript
exportdefault{data(){return{visible:false,dialogWidth:"1080px",}},created(){this.setDialogWidth()},mounted(){window.onresize=()=>{return(()=>{this.setDialogWidth()})()}},methods:{setDialogWidth(){varv
- javascript笔记5
michaelYH
时间Date对象方法及运算BOMwindow中常用方法window常用事件-onload加载事件和onunload卸载事件window中常用事件-onscroll滚动事件window中常用事件-onresize窗口变化事件时间//格里尼治时间//世界协调时间(1970年1月1日0点)Date对象方法及运算vard=Date();console.log(d);//TueSep04201818:17:
- Jquery之获取滚动距离方法
铁甲小宝爱编程
笔记jquery
获取浏览器显示区域(可视区域)的高度:$(window).height();获取浏览器显示区域(可视区域)的宽度:$(window).width();获取页面的文档高度$(document).height();获取页面的文档宽度:$(document).width();浏览器当前窗口文档body的高度:$(document.body).height();浏览器当前窗口文档body的宽度:$(doc
- javaScript常见事件的使用、原理及案例演示【超详篇】
是小言
javascript开发语言
文章目录JavaScript中什么是事件?事件的基本原理javaScript中事件的使用1,窗口事件1.1、onblur1.2、onfocus1.3、onload1.4、onresize2,表单事件2.1、onchange2.2、**oninput**2.3、oninvalid2.4、onselect2.5、onsubmit3,键盘事件3.1、onkeydown3.2、onkeyup3.3、onk
- Vue-图表resize事件
MINO吖
#Vuevueechartsresize
有时候我们会遇到这样的场景,一个组件中有几个图表,在浏览器resize的时候我们希望图表也进行resize,因此我们会在父容器组件中写:mounted() { setTimeout(() => window.onresize = () => { this.$refs.chart1.chartWrapperDom.resize() this.$refs.chart2.chartWrap
- 多线程编程之存钱与取钱
周凡杨
javathread多线程存钱取钱
生活费问题是这样的:学生每月都需要生活费,家长一次预存一段时间的生活费,家长和学生使用统一的一个帐号,在学生每次取帐号中一部分钱,直到帐号中没钱时 通知家长存钱,而家长看到帐户还有钱则不存钱,直到帐户没钱时才存钱。
问题分析:首先问题中有三个实体,学生、家长、银行账户,所以设计程序时就要设计三个类。其中银行账户只有一个,学生和家长操作的是同一个银行账户,学生的行为是
- java中数组与List相互转换的方法
征客丶
JavaScriptjavajsonp
1.List转换成为数组。(这里的List是实体是ArrayList)
调用ArrayList的toArray方法。
toArray
public T[] toArray(T[] a)返回一个按照正确的顺序包含此列表中所有元素的数组;返回数组的运行时类型就是指定数组的运行时类型。如果列表能放入指定的数组,则返回放入此列表元素的数组。否则,将根据指定数组的运行时类型和此列表的大小分
- Shell 流程控制
daizj
流程控制if elsewhilecaseshell
Shell 流程控制
和Java、PHP等语言不一样,sh的流程控制不可为空,如(以下为PHP流程控制写法):
<?php
if(isset($_GET["q"])){
search(q);}else{// 不做任何事情}
在sh/bash里可不能这么写,如果else分支没有语句执行,就不要写这个else,就像这样 if else if
if 语句语
- Linux服务器新手操作之二
周凡杨
Linux 简单 操作
1.利用关键字搜寻Man Pages man -k keyword 其中-k 是选项,keyword是要搜寻的关键字 如果现在想使用whoami命令,但是只记住了前3个字符who,就可以使用 man -k who来搜寻关键字who的man命令 [haself@HA5-DZ26 ~]$ man -k
- socket聊天室之服务器搭建
朱辉辉33
socket
因为我们做的是聊天室,所以会有多个客户端,每个客户端我们用一个线程去实现,通过搭建一个服务器来实现从每个客户端来读取信息和发送信息。
我们先写客户端的线程。
public class ChatSocket extends Thread{
Socket socket;
public ChatSocket(Socket socket){
this.sock
- 利用finereport建设保险公司决策分析系统的思路和方法
老A不折腾
finereport金融保险分析系统报表系统项目开发
决策分析系统呈现的是数据页面,也就是俗称的报表,报表与报表间、数据与数据间都按照一定的逻辑设定,是业务人员查看、分析数据的平台,更是辅助领导们运营决策的平台。底层数据决定上层分析,所以建设决策分析系统一般包括数据层处理(数据仓库建设)。
项目背景介绍
通常,保险公司信息化程度很高,基本上都有业务处理系统(像集团业务处理系统、老业务处理系统、个人代理人系统等)、数据服务系统(通过
- 始终要页面在ifream的最顶层
林鹤霄
index.jsp中有ifream,但是session消失后要让login.jsp始终显示到ifream的最顶层。。。始终没搞定,后来反复琢磨之后,得到了解决办法,在这儿给大家分享下。。
index.jsp--->主要是加了颜色的那一句
<html>
<iframe name="top" ></iframe>
<ifram
- MySQL binlog恢复数据
aigo
mysql
1,先确保my.ini已经配置了binlog:
# binlog
log_bin = D:/mysql-5.6.21-winx64/log/binlog/mysql-bin.log
log_bin_index = D:/mysql-5.6.21-winx64/log/binlog/mysql-bin.index
log_error = D:/mysql-5.6.21-win
- OCX打成CBA包并实现自动安装与自动升级
alxw4616
ocxcab
近来手上有个项目,需要使用ocx控件
(ocx是什么?
http://baike.baidu.com/view/393671.htm)
在生产过程中我遇到了如下问题.
1. 如何让 ocx 自动安装?
a) 如何签名?
b) 如何打包?
c) 如何安装到指定目录?
2.
- Hashmap队列和PriorityQueue队列的应用
百合不是茶
Hashmap队列PriorityQueue队列
HashMap队列已经是学过了的,但是最近在用的时候不是很熟悉,刚刚重新看以一次,
HashMap是K,v键 ,值
put()添加元素
//下面试HashMap去掉重复的
package com.hashMapandPriorityQueue;
import java.util.H
- JDK1.5 returnvalue实例
bijian1013
javathreadjava多线程returnvalue
Callable接口:
返回结果并且可能抛出异常的任务。实现者定义了一个不带任何参数的叫做 call 的方法。
Callable 接口类似于 Runnable,两者都是为那些其实例可能被另一个线程执行的类设计的。但是 Runnable 不会返回结果,并且无法抛出经过检查的异常。
ExecutorService接口方
- angularjs指令中动态编译的方法(适用于有异步请求的情况) 内嵌指令无效
bijian1013
JavaScriptAngularJS
在directive的link中有一个$http请求,当请求完成后根据返回的值动态做element.append('......');这个操作,能显示没问题,可问题是我动态组的HTML里面有ng-click,发现显示出来的内容根本不执行ng-click绑定的方法!
 
- 【Java范型二】Java范型详解之extend限定范型参数的类型
bit1129
extend
在第一篇中,定义范型类时,使用如下的方式:
public class Generics<M, S, N> {
//M,S,N是范型参数
}
这种方式定义的范型类有两个基本的问题:
1. 范型参数定义的实例字段,如private M m = null;由于M的类型在运行时才能确定,那么我们在类的方法中,无法使用m,这跟定义pri
- 【HBase十三】HBase知识点总结
bit1129
hbase
1. 数据从MemStore flush到磁盘的触发条件有哪些?
a.显式调用flush,比如flush 'mytable'
b.MemStore中的数据容量超过flush的指定容量,hbase.hregion.memstore.flush.size,默认值是64M 2. Region的构成是怎么样?
1个Region由若干个Store组成
- 服务器被DDOS攻击防御的SHELL脚本
ronin47
mkdir /root/bin
vi /root/bin/dropip.sh
#!/bin/bash/bin/netstat -na|grep ESTABLISHED|awk ‘{print $5}’|awk -F:‘{print $1}’|sort|uniq -c|sort -rn|head -10|grep -v -E ’192.168|127.0′|awk ‘{if($2!=null&a
- java程序员生存手册-craps 游戏-一个简单的游戏
bylijinnan
java
import java.util.Random;
public class CrapsGame {
/**
*
*一个简单的赌*博游戏,游戏规则如下:
*玩家掷两个骰子,点数为1到6,如果第一次点数和为7或11,则玩家胜,
*如果点数和为2、3或12,则玩家输,
*如果和为其它点数,则记录第一次的点数和,然后继续掷骰,直至点数和等于第一次掷出的点
- TOMCAT启动提示NB: JAVA_HOME should point to a JDK not a JRE解决
开窍的石头
JAVA_HOME
当tomcat是解压的时候,用eclipse启动正常,点击startup.bat的时候启动报错;
报错如下:
The JAVA_HOME environment variable is not defined correctly
This environment variable is needed to run this program
NB: JAVA_HOME shou
- [操作系统内核]操作系统与互联网
comsci
操作系统
我首先申明:我这里所说的问题并不是针对哪个厂商的,仅仅是描述我对操作系统技术的一些看法
操作系统是一种与硬件层关系非常密切的系统软件,按理说,这种系统软件应该是由设计CPU和硬件板卡的厂商开发的,和软件公司没有直接的关系,也就是说,操作系统应该由做硬件的厂商来设计和开发
- 富文本框ckeditor_4.4.7 文本框的简单使用 支持IE11
cuityang
富文本框
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>知识库内容编辑</tit
- Property null not found
darrenzhu
datagridFlexAdvancedpropery null
When you got error message like "Property null not found ***", try to fix it by the following way:
1)if you are using AdvancedDatagrid, make sure you only update the data in the data prov
- MySQl数据库字符串替换函数使用
dcj3sjt126com
mysql函数替换
需求:需要将数据表中一个字段的值里面的所有的 . 替换成 _
原来的数据是 site.title site.keywords ....
替换后要为 site_title site_keywords
使用的SQL语句如下:
updat
- mac上终端起动MySQL的方法
dcj3sjt126com
mysqlmac
首先去官网下载: http://www.mysql.com/downloads/
我下载了5.6.11的dmg然后安装,安装完成之后..如果要用终端去玩SQL.那么一开始要输入很长的:/usr/local/mysql/bin/mysql
这不方便啊,好想像windows下的cmd里面一样输入mysql -uroot -p1这样...上网查了下..可以实现滴.
打开终端,输入:
1
- Gson使用一(Gson)
eksliang
jsongson
转载请出自出处:http://eksliang.iteye.com/blog/2175401 一.概述
从结构上看Json,所有的数据(data)最终都可以分解成三种类型:
第一种类型是标量(scalar),也就是一个单独的字符串(string)或数字(numbers),比如"ickes"这个字符串。
第二种类型是序列(sequence),又叫做数组(array)
- android点滴4
gundumw100
android
Android 47个小知识
http://www.open-open.com/lib/view/open1422676091314.html
Android实用代码七段(一)
http://www.cnblogs.com/over140/archive/2012/09/26/2611999.html
http://www.cnblogs.com/over140/arch
- JavaWeb之JSP基本语法
ihuning
javaweb
目录
JSP模版元素
JSP表达式
JSP脚本片断
EL表达式
JSP注释
特殊字符序列的转义处理
如何查找JSP页面中的错误
JSP模版元素
JSP页面中的静态HTML内容称之为JSP模版元素,在静态的HTML内容之中可以嵌套JSP
- App Extension编程指南(iOS8/OS X v10.10)中文版
啸笑天
ext
当iOS 8.0和OS X v10.10发布后,一个全新的概念出现在我们眼前,那就是应用扩展。顾名思义,应用扩展允许开发者扩展应用的自定义功能和内容,能够让用户在使用其他app时使用该项功能。你可以开发一个应用扩展来执行某些特定的任务,用户使用该扩展后就可以在多个上下文环境中执行该任务。比如说,你提供了一个能让用户把内容分
- SQLServer实现无限级树结构
macroli
oraclesqlSQL Server
表结构如下:
数据库id path titlesort 排序 1 0 首页 0 2 0,1 新闻 1 3 0,2 JAVA 2 4 0,3 JSP 3 5 0,2,3 业界动态 2 6 0,2,3 国内新闻 1
创建一个存储过程来实现,如果要在页面上使用可以设置一个返回变量将至传过去
create procedure test
as
begin
decla
- Css居中div,Css居中img,Css居中文本,Css垂直居中div
qiaolevip
众观千象学习永无止境每天进步一点点css
/**********Css居中Div**********/
div.center {
width: 100px;
margin: 0 auto;
}
/**********Css居中img**********/
img.center {
display: block;
margin-left: auto;
margin-right: auto;
}
- Oracle 常用操作(实用)
吃猫的鱼
oracle
SQL>select text from all_source where owner=user and name=upper('&plsql_name');
SQL>select * from user_ind_columns where index_name=upper('&index_name'); 将表记录恢复到指定时间段以前
- iOS中使用RSA对数据进行加密解密
witcheryne
iosrsaiPhoneobjective c
RSA算法是一种非对称加密算法,常被用于加密数据传输.如果配合上数字摘要算法, 也可以用于文件签名.
本文将讨论如何在iOS中使用RSA传输加密数据. 本文环境
mac os
openssl-1.0.1j, openssl需要使用1.x版本, 推荐使用[homebrew](http://brew.sh/)安装.
Java 8
RSA基本原理
RS