Permalink
Browse files

Fix server if script include is in head tag rather than body tag

  • Loading branch information...
1 parent 944aea6 commit 5804ebab4a5e59d6052bf0d443612134df4c121e @marcuswestin committed Sep 14, 2011
Showing with 2 additions and 1 deletion.
  1. +1 −0 Changelog
  2. +1 −1 server.js
View
@@ -4,6 +4,7 @@ TODO
intended v0.4.7
+ Remove default port and host - just use what the current page uses by default
+ Treat Android devices as mobile, with regards to loading resources in one big response rather than individual requests
++ Now works if script include put in head
v0.4.6
+ Add server.setOpts and server.handleRequest
View
@@ -117,7 +117,7 @@ function _handleMainModuleRequest(reqPath, req, res) {
' if (!src) { return }',
' ' + (isSafari
? 'document.write(\'<script src="\'+ url +\'"></script>\')'
- : 'document.body.appendChild(document.createElement("script")).src = url'),
+ : 'document.getElementsByTagName("head")[0].appendChild(document.createElement("script")).src = url'),
'}')
for (var i=0, dependency; dependency = deps[i]; i++) {

0 comments on commit 5804eba

Please sign in to comment.