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
function xdomainajax() { | |
var win; | |
if (document.location == "otcsandbox.com") { | |
var content = "<html><body><scr"+"ipt>document.domain='otcsandbox.com';</scr"+"ipt><scr"+"ipt src='http://wheretogetjqueryfrom.com/jquery.js'></scr"+"ipt></body></html>"; | |
var iframe = document.createElement("iframe"); | |
document.body.appendChild(iframe); | |
win = iframe.contentDocument ? iframe : iframe.contentWindow ? iframe.contentWindow : iframe; | |
var doc = iframe.contentDocument ? iframe.contentDocument ? iframe.contentWindow ? iframe.contentWindow.document ? win.document; | |
doc.open(); |
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
(function(){ | |
if (window.vendor) return; | |
var _browsers = ["chrome","opera","safari","firefox","ie"]; | |
for (var i=0; i<_browsers.length; i++) { | |
if (_browsers[i] in window) { | |
window.vendor = window[_browsers[i]]; | |
break; | |
} | |
} | |
})(); |
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 src="../vendor/lab2.min.js"></script> | |
<script type="text/javascript"> | |
var start = (+new Date); | |
// load some scripts dependent on each other (in parallel but preserving execution order) | |
$LAB | |
.setOptions({AlwaysPreserveOrder:true}) | |
.script('a.js') | |
.script('b-needs-a.js') | |
.script('c-needs-b.js') |
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
<html> | |
<head> | |
<script src="LAB.js"></script> | |
... | |
<script> | |
function do_something() { /* ... */ } |
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> | |
<style>#link1, #link2 { display:none; }</style> | |
<script src="lab.js"></script> | |
<script> | |
$LAB.script("jquery.js").wait(function(){ | |
var ready = false, |
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
document.write("<div id='foo'></div>"); | |
// OR | |
var div = document.createElement("div"); | |
div.id = "foo"; | |
document.body.appendChild(div); | |
// keep in mind, body.appendChild will put this <div> at the end of the body, whereas document.write() will put it wherever it's called (probably in the middle of an element. | |
// SO.... |
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
// do the hack | |
document.childNodes[1].style.width = "100%"; // set the HTML to 100%/100% | |
document.childNodes[1].style.height = "100%"; | |
document.body.style.width = "100%"; // set the <body> to 100%/100% | |
document.body.style.height = "100%"; | |
var viewportDimsHack = this.treeBrowserDocument.createElement("div"); | |
viewportDimsHack.style.position = "fixed"; | |
viewportDimsHack.style.left = "0px"; | |
viewportDimsHack.style.top = "0px"; |
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
RewriteEngine on | |
RewriteRule ^kitty.jpg /nothing [R=204,L] |
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
LABEL LABEL2 UNIQUE UA's # OF USES | |
(empty) - 1 20553 | |
(unrecognized) - 740 10789 | |
(bots) - 354 111898 | |
Clients - 513 1727 | |
Windows (other) 39 166 | |
Windows IE 12301 94162 | |
Windows Chrome 770 23069 | |
Windows Safari 99 541 | |
Windows Opera 553 3645 |
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
// look ma, I have no dependencies, no need for any wrappers! | |
alert("bar.js is loaded!"); |