onmouseover in JavaScript not working

28 views
Skip to first unread message

Josh

unread,
Aug 5, 2011, 9:22:08 AM8/5/11
to django...@googlegroups.com
I'm new at Django and am experimenting with JavaScript in templates. 

I've put JavaScript from Google Charts in a block and it is displaying the chart properly. The onmouseover should display the details of elements in the chart, but that isn't working in Django. In a plain html-page it is displayed, so I guess it is being blocked by Django and I should enable this.

I've tried the {% autoescape on/off %} tag, but that doesn't solve it. How can I activate this? Basically I want no restrictions on these blocks with JavaScript.

bruno desthuilliers

unread,
Aug 5, 2011, 10:38:31 AM8/5/11
to Django users
On Aug 5, 3:22 pm, Josh <jos.carpente...@yahoo.com> wrote:
> I'm new at Django and am experimenting with JavaScript in templates.
>
> I've put JavaScript from Google Charts in a block and it is displaying the
> chart properly. The onmouseover should display the details of elements in
> the chart, but that isn't working in Django. In a plain html-page it is
> displayed, so I guess it is being blocked by Django and I should enable
> this.

Django doesn't "block" javascript, and is totally agnostic about
javascript FWIW.

> I've tried the {% autoescape on/off %} tag,

Escaping considerations only apply to dynamic content (=> content
inserted by the template system using either a {{ var }} or a {% tag
%}). See the "safe" (IIRC) filter to disable escaping on dynamic
content.

> but that doesn't solve it. How
> can I activate this?

There's nothing to "activate".


> Basically I want no restrictions on these blocks with
> JavaScript.

Basically, unless you inserted your js code (or any other markup)
using a {{ var }} or {% tag %}, there is NO "restrictions on these
blocks with javascript".

Did you at least inspected the *rendered* template to see how what
your HTML and js looks like ?

Josh

unread,
Aug 5, 2011, 11:30:31 AM8/5/11
to django...@googlegroups.com
>Basically, unless you inserted your js code (or any other markup)
>using a {{ var }} or {% tag %}, there is NO "restrictions on these
>blocks with javascript".

>Did you at least inspected the *rendered* template to see how what
>your HTML and js looks like ?

Thanks for pointing these things out about js. At least I know now that it isn't Django-related.

I checked the source and the relevant html and js is the same. I diffed the rendered js and there were no differences. Real strange though. I'll skip this thing and continue with some other js to see if this also gives problems.



Reply all
Reply to author
Forward
0 new messages