I am passing a list of dictionaries to my template. In the template
language I can do this and it works as expected:

{% for row in images %}
    <div class="gImage-row gImage_row-{{ forloop.counter0 }}">
        <a class='no-highlight' href="{{ IMAGE_DIR }}{{ row.image }}"
rel="superbox[image]">
        <img class='gImage' src="{{ IMAGE_DIR }}{{ row.image }}"
onerror="noimage(event)">
        </a>
    </div>
{% endfor %}

But I need to process this data in jQuery. If I pass images into a
function like this:

my_func({{ images }});

I get a syntax error, 'unexpected token &'

And if I pass it in like this:

my_func("{{ images }}");

It is received in the function as a character string, not as a list of
dictionaries. How can I pass this to my function and have it be
received as the list of dictionaries that it is?

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" 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-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to