I have a django project, but for some reason basic jquery isn’t working.
<html>
<head>
<link href="/site_media/css/poll.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="/site_media/js/jquery-1.3.2.js" />
<script type="text/javascript">
$(document).ready(function(){
alert('hi there');
});
</script>
</head>
etc…
For some reason the ready event isn’t firing. The jquery and css are both definitely present (firebug confirms that for me). There are no javascript errors on the page.
Am I missing something totally obvious, or is there something subtle in Django that requires configuration to allow jQuery to work with it.
EDIT:In fact, no javascript works after importing jquery! Adding a
<script type="text/javascript">alert("hi");</script>
works if placed before the jquery import, but not after.
It could be due to the missing
</script>end tag for the jQuery script inclusion line. For example:According to the note in the HTML specification for the
SCRIPTelement here, both the start and end tags are required.