Skip to content

Instantly share code, notes, and snippets.

@pikotea
pikotea / gist:6462456
Last active December 22, 2015 10:59
innerHTMLのスピードテスト
// firefox:
// test1a -> 18.83772399999998
// test1b -> 12.661566999999877
// test1c -> 0.32783100000006016
// chrome:
// test1a -> 53.948999993735924
// test1b -> 28.740999987348914
// test1c -> 0.7929999846965075
// 準備
@pikotea
pikotea / gist:3491756
Created August 27, 2012 19:55
jQuery Mobileでホワイトリスト使って読み込むページを制限する
var a = document.createElement('a');
function getInfo(url) {
a.href = url;
return {
host: a.host,
pathname: a.pathname
};
}
$(document).on('pagebeforeload', function(e, data){
// ホワイトリスト
(function(){
var avatar = document.querySelector('#avatar_me'),
pos,
keys = [];
var SPEED = 5;
document.addEventListener('keydown', keydown, false);
document.addEventListener('keyup', keyup, false);
function keydown(e) {