Created
July 22, 2015 23:58
-
-
Save gridwalk/0647d7b1debd4c480ecb to your computer and use it in GitHub Desktop.
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
// This function is for including static HTML in a NWJS page. (Node Webkit) | |
// usage: <script>include('header.html');</script> | |
var include = function(file){ | |
html = fs.readFileSync(file) | |
scripts = document.getElementsByTagName('script'); | |
lastScript = scripts[scripts.length-1]; | |
lastScript.insertAdjacentHTML("beforebegin", html); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment