Skip to content

Instantly share code, notes, and snippets.

@miohtama
Created May 29, 2015 19:24
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 miohtama/ce6d0a417b4fff1558ad to your computer and use it in GitHub Desktop.
Save miohtama/ce6d0a417b4fff1558ad to your computer and use it in GitHub Desktop.
Safely embed JSON data in Jinja / HTML for reading in JavaScript
<script>
window.deliveryLocations = JSON.parse("{{delivery_locations|escape_js}}");
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment