I return data like client names and descriptions via JsonResponse from Django. Is it safe to use this directly in the DOM, or do I need XSS protection? (normally I just use templates, and follow https://docs.djangoproject.com/en/5.2/ref/templates/builtins/#std-templatefilter-json_script, but this needs to be loaded in dynamically)
# Fetching data from ORM...
return JsonResponse([{
'title': f"{client.first_name} {client.last_name}",
...
}], safe=False)
How do you access this securely in my JS?
Like this? (in this case the fetch happens in fullcalendar event)
const title = event.extendedProps.title
Or should i create divs, and set the textContent of those to the values before?