Personally I tend to attach data attributes to the wrapping node for the
map/chart at HTML escaped JSON and then read them from an external JS file.
Especially as that js can be fairly complex it's best to keep it outside
the template where it can be compressed.

But we digress. I'm in favour of mark_safe having a name which suggest HTML
as that's what it does. I don't however think it will stop people doing it
wrong. However, I'm not sure if there's an easy way to apply your own
default escape function (instead of HTML escaping) say if you are
outputting a JS or TeX doc and have written an escaper you're happy with.
We may as well make this pluggable.

Marc
On 17 Oct 2013 09:06, "Daniele Procida" <[email protected]> wrote:

> On Wed, Oct 16, 2013, Jonathan Slenders <[email protected]>
> wrote:
>
> >Some people still have javascript in their templates and they use template
> >tags inside their javascript. :(
>
> I am not sure if you're saying this is a bad thing, but it is unavoidable,
> isn't it? For example I use the Google Maps API, and I don't know of any
> other way to generate the map items dynamically than to build some of the
> JS for it using template tags. Is there a problem doing it like this, and
> is there a better way?
>
> Daniele
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django developers" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/django-developers.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-developers/20131017080600.1363122391%40smtp.modern-world.net
> .
> For more options, visit https://groups.google.com/groups/opt_out.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/CAMwjO1GxEKy-%2BM%2Br10joeTsnaoqm4QCojnVj6%2BSKwu2%3DPdJFVw%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to