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
<script> | |
console.log(document.readyState); | |
document.onreadystatechange = function () { | |
console.log(document.readyState); | |
}; | |
window.onload = function () { | |
console.log("onload: " + document.readyState); | |
}; | |
document.addEventListener('DOMContentLoaded', function () { | |
console.log("domready!"); |
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
某个同学的原始版本是这样的。 | |
var arr = new Array(25,35,4,2,8,1,5,3,9,15); | |
for(i = 0 ; i < arr.length ; i++){ | |
eval("setTimeout(function(){document.write(arr["+i+"] + ' ');},arr["+i+"]);"); | |
} | |
以下是改进版: | |
var arr = [25,35,4,2,8,1,5,3,9,15]; | |
var len = arr.length, sorted = []; | |
for(var i = 0; i < len; i++){ |
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:(function() {var s=document.documentElement.outerHTML;var w=window.open('xx','');w.document.write(s.replace(/</g, "<").replace(/>/g, ">"));w.focus();}()); |
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
// EventProxy https://github.com/JacksonTian/eventproxy/blob/master/eventproxy.js | |
/** | |
* 显示指定用户 profile 页面 | |
* | |
* 获取关注和被关注的数据 | |
* 获取此用户最近的活动数据 | |
* - 活动数据里面包含各种数据的聚合 | |
* 判断当前登录的用户与指定用户是否已经相互关注 | |
* | |
*/ |
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> | |
<head> | |
<meta charset="utf-8" /> | |
<title>test slider v3</title> | |
<style> | |
body { | |
font-family: Georgia, serif; | |
} | |
#slider1, #slider2 { |
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
var fs = require("fs"); | |
var filePath = "../assets/images_out/action_pressed.png"; | |
fs.readFile(filePath, function (err, buffer) { | |
if (err) { | |
console.log(err); | |
} else { | |
var prefix = 'data:image/png;base64,'; | |
var datauri = prefix + buffer.toString('base64'); | |
fs.writeFile(filePath + ".txt", datauri, function (err) { | |
if (err) throw err; |
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
.tab-panel .tabs li:nth-child(5n+1) { | |
z-index: 10; | |
} | |
.tab-panel .tabs li:nth-child(5n+2) { | |
z-index: 9; | |
} | |
.tab-panel .tabs li:nth-child(5n+3) { | |
z-index: 8; | |
} | |
.tab-panel .tabs li:nth-child(5n+4) { |
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
Devices landscape(w/h) portrait(w/h) | |
HTC g10 533/260 320/473 | |
ipad1 1024/690 768/946 | |
ipad2 1024/690 768/946 | |
Samsung9100 533/237 320/450 | |
Samsung9000 533/239 320/452 | |
LePhone 533/250 320/463 | |
ipod(4.2.1) 480/208 320/356 | |
//以下数据来自支付宝 颂赞 | |
MOROTOLA ME722 320/488 569/239 |
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
Usage: | |
b.plug(f.PlaceholderPlugin); |
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="fr-FR"> | |
<head> | |
<meta charset="utf-8" /> | |
<title>GEO</title> | |
</head> | |
<body id="index"> | |
<script> | |
navigator.geolocation.getCurrentPosition(function (position) { | |
console.log(JSON.stringify(position)); |
OlderNewer