Skip to content

Instantly share code, notes, and snippets.

@pocotan001
pocotan001 / gist:1183673
Created August 31, 2011 14:29
ブックマークレット: ファーストビュー確認用(550px)
javascript:(function(){var d=document,o=d.createElement('div');with(o.style){position='fixed';top='550px';left='0';width='100%';height='100%';borderTop='1px #f00 solid';backgroundColor='rgba(255,255,255,.9)';color='#fff';fontSize='10px';zIndex='10000';}o.innerHTML='<p style='position:absolute;top:0;left:0;margin:0;padding:0pt 8px;background-color:#f00;'>550px</p>';d.body.appendChild(o);})();
// Uncompressed
javascript:
(function(){
var d = document,
o = d.createElement('div');
with(o.style){
@pocotan001
pocotan001 / gist:1183656
Created August 31, 2011 14:19
ブックマークレット: グローバル変数を一覧(alert,consoleに出力)
javascript:(function(){var d=document,f=d.createElement('iframe'),b=d.body,o={0:1,getInterface:1,GetWeakReference:1,console:1,loadFirebugConsole:1,_createFirebugConsole:1,_firebug:1,_FirebugCommandLine:1},c=typeof this.console!='undefined',r='';f.src=d.URL+'?';b.appendChild(f);var w=f.contentWindow;for(var i in this){if(!(i in w)&&!o[i]&&!/^script\d{13}$/.test(i)){r+=i+'\n';if(c)console.log(i+':',this[i]);}}b.removeChild(f);alert(r);})();
// Uncompressed
javascript:
(function(){
var d = document,
f = d.createElement('iframe'),
b = d.body,
o = {
@pocotan001
pocotan001 / gist:1183608
Created August 31, 2011 14:02
Utilities
/**
* getElementById wrapper.
* @param {String} 要素の一意のIDを表す文字列
* @returns {Element} 一致する要素
*/
function $(id){
return $[id] || ($[id] = document.getElementById(id));
}
/**
@pocotan001
pocotan001 / gist:1180581
Created August 30, 2011 10:02 — forked from ahomu/gist:877105
わくわくjQuery編
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="utf-8" />
<title>わくわくjQuery編</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js" type="text/javascript"></script >
<script type="text/javascript">
$(function()
{
// ★ 画像の読み込みをテキトーに待つよ