I’m using Django and I have an HTML file, with this line in the head tag:
<script type="text/javascript" src="/path/to/jquery.js"></script>
This works fine in Chrome, but it seems to have no effect in Firefox 3.6.18. (When I type in $ or jQuery in the Firefox console, I get an error, whereas Chrome just shows it correctly.) The rest of my scripts can’t load because of this.
I tried strace, and it seems like the file is, in fact, loaded.
What could be causing this?
More info:
I can’t post a lot of the HTML, but some relevant parts:
My HTML file (Django templates):
{% extends "my_base.html" %}
{% load stuff %}
{% block head %}
{{ block.super }}
<script type="text/javascript" src="/media/jquery_listbox/js/jquery-min.js"></script>
<script type="text/javascript" src="/media/jquery_listbox/js/ui.core-min.js"></script>
<script type="text/javascript" src="/media/jquery_listbox/js/ui.dropdownchecklist-min.js"></script>
<link rel="stylesheet" type="text/css" href="/media/jquery_listbox/css/ui.dropdownchecklist.css" />
{% endblock %}
my_base.html:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<link rel="stylesheet" type="text/css" href="default.css"/>
{% block head %}{% endblock %}
</head>
...
</html>
It’s hard to tell without seeing the rest of your HTML. With Firebug installed, you can check the Net tab to make sure the jQuery file is requested and returned correctly in Firefox. Or replace the
srcwith Google’s hosted jQuery which ishttps://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js– if that works then you know it’s a location problem, not a code problem.