function getQueryStringArgs(){
//查询是否有query的参数,如果有就去掉其中的?后返回后续的具体内容 返回type=music&loc=ningbo
let qs = location.search.length > 0 ? location.search.substring(1) ? '';
//判断是否有query参数,将各个参数项分开为type=music和loc=ningbo两部分
let items = qs.length ? qs.split("&") : [];
let args = {};
let name = null, value = null, item = null;
for(let i = 0; i < items.length; i++){
//分别将各个query项进行键值分离为type和music、loc和ningbo
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
import React, { | |
Component, | |
View, | |
Text, | |
NavigatorIOS, | |
ListView, | |
} from 'react-native'; |
let lists = document.querySelectorAll('li');
let listsArray = Array.prototype.slice.call(lists, 0);
通过使用slice方法将NodeList类型转换为Array类型
#事件代理/委托 ##事件流 事件流分为两类,IE6的冒泡事件流和非IE6的捕获事件流。 ##IE冒泡事件流 冒泡的这种相对简单一些,就是子元素触发一个特定事件,然后这个事件发生后会不怕事大的一直向上层父组件进行传递广播,最终传递到HTML标签的document为止。 ##捕获事件流 与冒泡相比,捕获事件流相对就多了些内容。触发事件的这个子元素它是整个事件传播过程的中点,始发于document(html标签)对象,经过一系列父组件到达惹事的子元素标签处,然后就原路返回。 所以整个捕获事件流可以分为三个部分:
捕获阶段 --> 目标阶段(在触发事件的节点上,会发生两次) -->冒泡阶段
#null 和 undefined ##理论区别(然并卵) null是一个表示无的对象,当其被转为数值对象时为0。 undefined是一个表示无的原始值,转为数值时为NaN ##实际用法 null表示没有对象,即该处不应该有值。
- 作为函数参数,表示该函数的参数不是对象。
- 作为对象原型链的重点---Object.prototype = null (一个空对象)
undefined表示缺少值,即此处可以有值,但还没有定义
HTML结构
<div class="box">
<div class="box-top">
<div class="bd bd-1"></div>
<div class="bd bd-2"></div>
<div class="bd bd-3"></div>
<div class="bd bd-4"></div>
<div class="bd bd-5"></div>
</div>
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"presets": ["babel-preset-es2015"] | |
} |
String.prototype.firstUpperCase = function(){
return this.replace(/\b(\w)(\w*)/g, function($0, $1, $2) {
return $1.toUpperCase() + $2.toLowerCase();
});
}
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Test CSS Background ...</title> | |
<style> | |
.panorama{ | |
width: 500px; | |
height: 300px; | |
background-image: url(http://7vilbi.com1.z0.glb.clouddn.com/blog/6608185829213862083.jpg); |
OlderNewer