Created
August 29, 2013 15:45
-
-
Save lisp-ceo/6379806 to your computer and use it in GitHub Desktop.
Writing blocks of JSON to a document can be a good way to save a DB call. The script block increases the size of the document but it means JavaScript functions can proceed from the DOMContent event, not the Load. Here is some pseudo HTML for how you can access it from your file.
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
<html> | |
<head> | |
<script type='text/javascript'> | |
window.wineData = { | |
.. | |
}; | |
</script> | |
</head> | |
<body> | |
<script type='text/javascript'> | |
var visualization = function(){ | |
... | |
}; | |
visualization.loadData( window.wineData ); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment