Skip to content

Instantly share code, notes, and snippets.

@TeeTeeHaa

TeeTeeHaa/code.js

Created Jun 24, 2012
Embed
What would you like to do?
example for issue in node-static 0.5.9
function onload()
{
// Firefox
document.getElementById("test").textContent = "good :)";
// Internet Explorer
document.getElementById("test").innerText = "good :)";
}
files must be located within the following directory layout:
.
| server.js
\---public
\---path
code.js
index.html
<html>
<head>
<title>node-static 0.5.9 bug</title>
<script type="text/javascript" src="code.js"></script>
</head>
<body onload="onload();">
<div id="test">bad :(</div>
</body>
</html>
var static = require('node-static');
var file = new(static.Server)('./public');
require('http').createServer(function (request, response) {
request.addListener('end', function () {
file.serve(request, response);
});
}).listen(80);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment