Skip to content

Instantly share code, notes, and snippets.

<!doctype html>
<html lang="en" dir="ltr">
<head>
<title>NodeList/HTMLCollection conversion/concatenation to array (testing)</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<script type="text/javascript">
// get elapsed time
function timeElapsed(t) { return ((new Date()).getTime() - t); }
onload = function() {
@dperini
dperini / gist:179535
Created September 2, 2009 03:36 — forked from kangax/gist:179491
// first alert(1), then alert(2)
var foo = 1;
alert(1);
var bar = (function(){ alert(2); })();
// first alert(2), then alert(1)
var foo=1,bar=(function(){alert(2);})();alert(1);
<html>
<head>
<title>Quirk Mode Test for Safari 2.0.x and other old browsers</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<script type="text/javascript">
// adapted from http://code.google.com/p/doctype/wiki/ArticleCompatMode
document.compatMode || (document.compatMode =
(function() {
var el; (el = document.createElement('div')).style.width = 1;
return el.style.width == '1px' ? 'BackCompat' : 'CSS1Compat';
/* can you spot what is happening here */
/* the alert("X") should never execute */
<script>
onload = function() {
var fn = function() {
alert("X");
}
(function() { })();