Friday, October 28, 2011

Help in adding jQuery to my pages

Hi all,

I'm trying to add a bit of jQuery to a page in a Django site. It seems
that my jQuery scripts are simply not loaded, while JS scripts work
perfectly.
Evan Firebug does not see the jQuery file as loaded.

This is what I do in base.html

   <head>
       <link href="/static/base.less" rel="stylesheet/less" type="text/css">
       <script src="/static/less.js" type="text/javascript"></script>
       {% block javascript %}{% endblock %}

and in my page

{% block javascript %}
<script src="/static/jquery-1.6.4.js" type="text/javascript"></script>
<script src="/static/tabs.js" type="text/javascript"></script>
{% endblock %}

and my tabs.js is

$(document).ready(function() {
$('li').addClass("active");
}

If I edit jquery-1.6.4.js and add something as alert(), this works
perfectly. Other JS scripts work like a charm.

Any suggestion?

Thank you

Leo

--
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.

No comments:

Post a Comment