上一页 1 ··· 9 10 11 12 13
摘要: PS:join()数组转串,split()串转数组 1、test():在字符串查找符合正则的内容,如果查找到返回true,反之返回false用法:正则.test(字符串)2、search():在字符串搜索符合正则的内容,找到就返回出现的位置index。如果有多个相匹配的,只会返回第一个匹配的位置。搜 阅读全文
posted @ 2018-12-26 17:06 YJUI 阅读(308) 评论(0) 推荐(0) 编辑
摘要: <!doctype html> <html> <head> <meta charset="UTF-8"> <title>实现带样式的表单验证 </title> <style> table{width:700px} /*父元素下的第1个,第n个,最后一个td子元素*/td:first-child{wi 阅读全文
posted @ 2018-12-25 15:25 YJUI 阅读(1337) 评论(0) 推荐(0) 编辑
摘要: <!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8"> <title>Title</title></head><body><div id="keys"> <button>1</button> <button>2</button> <b 阅读全文
posted @ 2018-12-24 17:01 YJUI 阅读(346) 评论(0) 推荐(0) 编辑
摘要: (1)JSON.parse函数 作用:将json字符串转换成json对象。 语法:JSON. parse(text[,reviver]). 参数:text 必须;一个有效的json字符串。 reviver 可选。 返回值:一个对象或数组。 example: var json = '{"name":" 阅读全文
posted @ 2018-12-21 11:44 YJUI 阅读(295) 评论(0) 推荐(0) 编辑
摘要: 自有属性和共有属性: 自有属性:直接保存在对象本地的属性 共有属性:保存在原型对象中,被所有子对象共享的属性 获取时:都可用对象.属性方法 赋值时:自有属性,必须:对象.属性 = 值 共有属性,必须:构造函数.prototype.属性 = 值 鉴别自有还是共有: 自有:var bool = obj. 阅读全文
posted @ 2018-12-21 10:57 YJUI 阅读(456) 评论(0) 推荐(0) 编辑
摘要: 1.对象的内部属性[[prototype]]和属性__proto__:每个对象都具有一个名为__proto__的属性; 2.函数的属性prototype:每个构造函数(构造函数标准为大写开头,如Function(),Object()等等JS中自带的构造函数,以及自己创建的)都具有一个名为protot 阅读全文
posted @ 2018-12-20 15:38 YJUI 阅读(282) 评论(0) 推荐(0) 编辑
摘要: prototype 阅读全文
posted @ 2018-12-20 15:00 YJUI 阅读(174) 评论(0) 推荐(0) 编辑
摘要: attribute是HTML标签上的特性,它的值只能够是字符串;html 上id,class property是JavaScript里定义的对象; 如var obj={x:1,y:2} ,这里x,y就是属性property 阅读全文
posted @ 2018-12-20 11:51 YJUI 阅读(130) 评论(0) 推荐(0) 编辑
摘要: 三类对象:内置对象,宿主对象,自定义对象 两类属性:自有属性,继承属性 阅读全文
posted @ 2018-12-20 11:38 YJUI 阅读(237) 评论(0) 推荐(0) 编辑
摘要: nodeType 1元素节点,2属性节点,3文本节点 事件坐标:事件发生时,鼠标的位置 相对于屏幕左上角:e.screenX | screenY 相对于文档显示区左上角:e.clientX | e.clientY 相对于事件绑定的元素:e.offsetX | e.offsetY 事件坐标:3种坐标系 阅读全文
posted @ 2018-12-20 11:12 YJUI 阅读(293) 评论(0) 推荐(0) 编辑
摘要: 练习1:结果:0 5 0 / 0 undefined 0 var a=5;function test(){ a=0; console.log(a) console.log(this.a) var a; //去掉,test()结果0 0 0 console.log(a)}test(); //0 5 0 阅读全文
posted @ 2018-12-20 10:07 YJUI 阅读(158) 评论(0) 推荐(0) 编辑
摘要: <!DOCTYPE HTML><html><head> <title>:target切换</title> <meta charset="utf-8" /> <style> *{margin:0;padding: 0;} #tab li{float: left;list-style: none;wid 阅读全文
posted @ 2018-12-19 18:23 YJUI 阅读(368) 评论(0) 推荐(0) 编辑
摘要: position:relative:相对,取决自己absolute:绝对,相对于最近定位的相对定位fixed:固定,相对窗口 行内变块元素方法:1、float2、display:block;3、绝对定位 IE6不支持 阅读全文
posted @ 2018-12-19 15:20 YJUI 阅读(115) 评论(0) 推荐(0) 编辑
摘要: 1、创建4*4二维数组,r行内向空数组中添加每一行数组 var data=[];for(var r=0;r<4;r++){ data[r]=[]; //向空数组中添加每一行数组 for(var c=0;c<4;c++){ data[r][c]=0; }}console.log(data.join(' 阅读全文
posted @ 2018-12-14 16:17 YJUI 阅读(499) 评论(0) 推荐(0) 编辑
摘要: call apply bind 区别? 例:定义一个计算器,没绑定bind的为公共计算器,call可以调用,绑定bind的为私人计算器,别人调用不了, //ps:用bind绑定的call强制作借用不好用了, function calc(base,bonus){ console.log( this.e 阅读全文
posted @ 2018-12-14 10:54 YJUI 阅读(249) 评论(0) 推荐(0) 编辑
摘要: 一、数组API实际开发中forEach和map会多一些=>是es6语法中的arrow function举例:(x) => x + 6相当于function(x){return x + 6;}undefined转成数字是NaN判断:arr.every():判断arr中每个元素是否都符合要求只有每个元素 阅读全文
posted @ 2018-12-14 10:48 YJUI 阅读(551) 评论(0) 推荐(0) 编辑
摘要: $(function(){ //适配本地和测试环境 var host = "http://api.bch.xuemao.com", xmhost = 'http://dev.www.xuemao.com'; var winurl = (window.location.href).split('/') 阅读全文
posted @ 2018-12-11 15:43 YJUI 阅读(371) 评论(0) 推荐(0) 编辑
摘要: 全局定义:var obj1={}, obj2=[],obj3=obj2; 一、验证原型对象:1、Object.getPrototypeOf(obj2)==Array.prototype 2、Array.prototype.isPrototypeOf(obj2) >判断fater是否是child的父对 阅读全文
posted @ 2018-12-10 17:51 YJUI 阅读(218) 评论(0) 推荐(0) 编辑
摘要: $(function(){ //适配本地和测试环境 var host = "http://api.bch.XXX.com", xmhost = 'http://dev.www.XXX.com'; var winurl = (window.location.href).split('/')[2]; i 阅读全文
posted @ 2018-12-10 14:10 YJUI 阅读(598) 评论(0) 推荐(0) 编辑
上一页 1 ··· 9 10 11 12 13