Passing Python Values to JS in Wagtail

{{ my_info|json_script:"my-info" }}
info = JSON.parse(document.getElementById(‘my-info’).textContent); 
Photo by Quino Al on Unsplash

--

--

--

Developer, I also make art and listen to techno https://www.kevinhowbrook.com/

Love podcasts or audiobooks? Learn on the go with our new app.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Kevin howbrook

Kevin howbrook

Developer, I also make art and listen to techno https://www.kevinhowbrook.com/

More from Medium

Using Javascript in Python

DOMinating Coding

Building a slot machine simulator from scratch using django

How to Improve Programming Skills in Python

How to Improve Programming Skills in Python