Created
October 11, 2015 23:48
-
-
Save robert-chiniquy/f7c59d14b92bf0985ef2 to your computer and use it in GitHub Desktop.
Window load event in smokestack?
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
#! /usr/bin/env node | |
var Readable = require('stream').Readable; | |
var browserify = require('browserify'); | |
var smokestack = require('smokestack'); | |
var setup = new Readable(); | |
setup.push((function() { | |
var content = document.createElement('div'); | |
content.appendChild(document.createTextNode("So far so good")); | |
document.body.appendChild(content); | |
console.log('Try both window.onload and window.addEventListener'); | |
window.onload = function() { | |
console.log('Hello from window.onload'); | |
}; | |
window.addEventListener("load", function () { | |
console.log('Hello from addEventListener'); | |
}); | |
}).toString().slice(13,-1)); | |
setup.push(null); | |
browserify(setup) | |
.bundle() | |
.pipe(smokestack()) | |
.pipe(process.stdout); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment