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
/** | |
* 分析豆瓣阅读查看电子书的逻辑 | |
* | |
* 主要用到的JavaScript为 | |
* 1. OzJS(管理模块) | |
* 2. jQuery(base库) | |
* 3. Backbone.js(web application框架) | |
* | |
* 过程分析 | |
* -------- |
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"> | |
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0"> | |
<title>Auto play html audio in iOS WeChat InAppBrowser the right way</title> | |
</head> | |
<body> | |
<h1>在 iOS 微信浏览器中自动播放 HTML5 audio(音乐) 的正确方式</h1> | |
<p>核心原理: 在微信的JS-API 中 play 一下 audio 即可达到自动播放的目的(应该是微信自己做了处理)</p> |
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>a-domain</title> | |
</head> | |
<body> | |
<h1>跨域通信机制 - postMessage</h1> | |
<h2>a-domian.html</h2> | |
<iframe class="js-iframe" src="http://localhost:3000/other-domain.html"></iframe> |
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
/** | |
* 获取12306余票信息 | |
* | |
* 查询列车的余票信息 | |
* GET https://dynamic.12306.cn/otsweb/order/confirmPassengerAction.do?method=getQueueCount&train_date=2013-02-05&train_no=240000D31307&station=D313&from=VNP&to=SHH | |
* | |
* URL参数解析 | |
* train_date // 不用说了吧 | |
* train_no // 列车ID, 在余票查询结果车次的span中可以得到 | |
* station // 车次 |
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
<!-- test pass with CryptoJS v3.1.2 --> | |
<script src="rollups/tripledes.js"></script> | |
<script src="components/mode-ecb.js"></script> | |
<script> | |
/** | |
* Encrypt message by DES in ECB mode and Pkcs7 padding scheme | |
* | |
* NOTE: DES is weak, please use 3DES(Triple DES) or AES | |
* | |
* @param {String} message |
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"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<meta http-equiv="X-UA-Compatible" content="ie=edge"> | |
<title>Mobile HLS video</title> | |
</head> | |
<body> | |
<h1>Mobile HLS video</h1> |
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"> | |
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0"> | |
<title>Sanitize HTML with jQuery</title> | |
</head> | |
<body> | |
<h1>Sanitize HTML with jQuery</h1> | |
<h2>HTML Code</h2> |
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"> | |
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0"> | |
<title>Fake auto play html audio in iOS Safari the right way</title> | |
</head> | |
<body> | |
<h1>在 iOS Safari 中假装自动播放 HTML5 audio(音乐) 的正确方式</h1> | |
<p>核心原理: 通过一个用户交互事件来主动 play 一下 audio</p> |
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
Show hidden characters
{ | |
"alignment_chars" : ["=", ":"] | |
} |
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>CSS3 Transform create new stacking context</title> | |
<style> | |
.transform-el, | |
.bottom-el { | |
position: absolute; | |
height: 120px; |
NewerOlder