Skip to content

Instantly share code, notes, and snippets.

@TeeTeeHaa
Created June 24, 2012 15:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save TeeTeeHaa/2983697 to your computer and use it in GitHub Desktop.
Save TeeTeeHaa/2983697 to your computer and use it in GitHub Desktop.
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