Hi,vevanin. Django 1.3 updated the staticfiles server, you should use STATIC_URS to replace your MEDIA_URL in your template.
在 2011年7月31日星期日,vevanin@yandex.ru <vevanin@yandex.ru> 写道:
> I don't understand how can I use jquery with Django.
> I made a template:
> <html>
> <head>
> <title>test</title>
> <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
> <script type="text/javascript" src="{{ MEDIA_URL }}js/
> jquery-1.6.1.min.js"></script>
> </head>
> <body>
> <script type="text/javascript">
> $("<div><p>hello!</p></div>").appendTo("#testid");
> </script>
> <div id="main">
> <div id="testid">
> <p>test</p>
> </div>
> </div>
> </body>
> </html>
>
> In settings.py file I wrote: MEDIA_URL = '/static/'
> There is a 'static/js' folder in my application folder, and it has a
> jquery-1.6.1.min.js in it.
> This doesn't work. Could anyone help me?
>
> --
> 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+unsubscribe@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
>
> --
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+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment