Have a JSON object that I'm trying to pass to my Javascript through a script tag in my markup like so:
<script type="text/json" id="json-data">
{
"terms": "{{ entry.termsAgreement }}",
"sectionHeader": {{ entry.formSection }}
}
However, I'm getting an error that says:
Object of class Craft\ElementCriteriaModel could not be converted to string
.
formSection is a Matrix field. How can I pass this along to have access to it in Javascript? I tried
JSON.stringify({{ entry.formSection }})
but no luck.
Thanks.