This file contains hidden or 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
| (function(){ | |
| var df1 = document.createDocumentFragment(); | |
| df1.appendChild(document.createElement('A')); | |
| var df2 = document.createDocumentFragment(); | |
| df2.appendChild(df1); | |
| alert(df1.firstChild && df1.firstChild.nodeName); // null | |
| alert(df2.firstChild && df2.firstChild.nodeName); // A |
This file contains hidden or 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
| (function(){ | |
| var acme = {}; if (this.acme == null) this.acme = acme; | |
| /// ---------------------- /// | |
| /// !!! acme.ByteArray !!! /// | |
| /// ---------------------- /// | |
| acme.ByteArray = function ByteArray(n) { | |
| if (!(this instanceof ByteArray)) return new ByteArray(n); |
This file contains hidden or 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
| (function(){ | |
| function aaa() { | |
| var i = 100 / 10;// aaa | |
| // aaa | |
| i++; | |
| /* | |
| alert(i); | |
| */ | |
| /*/*/ |
This file contains hidden or 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 f=function(){ | |
| var a=[]; | |
| function d(){ | |
| a.shift().apply(d,arguments); | |
| } | |
| d.add=function(f){ | |
| a.push(f); | |
| return d; | |
| }; |
This file contains hidden or 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
| <p class="search_box"> | |
| 検索:<input type="text" size="50" id="Q" autocomplete="off"> <button id="S">検索</button> <a href="#OPTION_PANE" id="OPTION_TOGGLE">オプション</a> | |
| </p> | |
| <p id="OPTION_PANE" class="option_box"> | |
| プレイヤーサイズ: | |
| <select id="PLAYER_DIMENSION"> | |
| <option value="320x240">320x240</option> | |
| <option value="640x480">640x480</option> | |
| <option value="800x600" selected="selected">800x600</option> | |
| <option value="full">フル</option> |
This file contains hidden or 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 ifr = document.createElement('iframe'); | |
| ifr.src = 'data:text/html;charset=utf-8,%3Chtml%3E%0D%0A%3Cbody%3E%0D%0A%3Cscript%20type%3D%22text%2Fjavascript%22%3E%0D%0Awindow.addEventListener(%22message%22%2C%20receiveMessage%2C%20false)%3B%0D%0Afunction%20receiveMessage(e)%20%7B%0D%0A%20%20%20%20alert(localStorage%5B%22aaa%22%5D)%3B%0D%0A%20%20%20%20localStorage%5B%22aaa%22%5D%20%3D%20e.data%3B%0D%0A%20%20%20%20alert(localStorage%5B%22aaa%22%5D)%3B%0D%0A%7D%0D%0A%3C%2Fscript%3E%0D%0A%3C%2Fbody%3E%0D%0A%3C%2Fhtml%3E%0D%0A'; | |
| document.body.appendChild(ifr); | |
| ifr.addEventListener('load', function() { | |
| alert('post'); | |
| ifr.contentWindow.postMessage('aaaaaaaaaa', '*'); | |
| }, false); | |
| })() |
This file contains hidden or 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
| if (window.top != window.self) { | |
| // たぶん BackCompat じゃないと動かない。 | |
| if (this.scrollable.isRoot()) { | |
| document.body.style.height = '100%'; | |
| document.body.style.overflow = 'hidden'; | |
| } | |
| detach.push(subscribe(window, 'focus', bind(this, function() { | |
| var left = -parseInt(document.documentElement.style.marginLeft, 10) || 0; | |
| var top = -parseInt(document.documentElement.style.marginTop, 10) || 0; | |
| document.documentElement.style.marginLeft = ''; |
This file contains hidden or 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
| // ==UserScript== | |
| // @name myopera - stop autosave. | |
| // @include http://my.opera.com/*/blog/* | |
| // ==/UserScript== | |
| (function(){ | |
| var targets = [ | |
| 'http://static.myopera.com/community/js/site/blog/autosave-min.js' | |
| ]; | |
| window.opera.addEventListener('BeforeExternalScript', function(e) { | |
| var src = e.element.src; |
This file contains hidden or 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 getValidCssPropertyName = (function() { | |
| function camelize(str) { | |
| return str.replace(/-([a-z])/g, function($0,$1) { return $1.toUpperCase() }); | |
| } | |
| function decamelize(str) { | |
| return str.replace( /[A-Z]/g, function($0) { return "-" + $0.toLowerCase() }); | |
| } | |
| var tmpStyle = null; | |
| function getValidCssPropertyName(cssStr, forJS) { | |
| if (!cssStr) return ''; |
This file contains hidden or 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
| /** | |
| * EventDispatcher | |
| * @see http://www.fladdict.net/blog-jp/archives/2005/06/javascript.php | |
| * @see http://nanto.asablo.jp/blog/2007/03/23/1339498 | |
| */ | |
| function EventDispatcher(thisObj) { | |
| if (this instanceof EventDispatcher) { | |
| this.addEventListener = addEventListener; | |
| this.removeEventListener = removeEventListener; | |
| this.dispatchEvent = dispatchEvent; |