On Mar 25, 10:45 am, Oumayrita <amira.hamza...@hotmail.com> wrote: > Hello Friends, > I have a drop-down menu for navigation like this > on:http://www.softcomplex.com/products/tigra_menu/ > I need to display dynamically the list of Products Demo from the data > base. > So I need to know how return var to js file?? > And how use template language in js file? > Please answer me as soon as possible.
The best way is to have a <script> element in your Django template file, in which you set any variables your JS needs to access. {% block extrahead %} <script type="text/javascript"> var myvar = "{{ django_var }}" </script> {% endblock %} Your other JS can now access myvar. -- DR. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---