Skip to content

Instantly share code, notes, and snippets.

@lisp-ceo
Created August 29, 2013 15:45
Show Gist options
  • Save lisp-ceo/6379806 to your computer and use it in GitHub Desktop.
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.
<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