Note that there are some explanatory texts on larger screens.

plurals
  1. POInclude JQuery countdown in Django
    primarykey
    data
    text
    <p>I'm new with Django and this question is probably very basic. I would like to implement this Jquery countdown (http://keith-wood.name/countdown.html) in my Django app. But I have no idea how to include some javascript in my django templates. Here is what I tried to include in my template:</p> <pre><code>&lt;script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js"&gt;&lt;/script&gt; &lt;style type="text/css"&gt;@import "/Users/marc-antoine.lacroix/Desktop/JQuery/jquery.countdown.package-1.6.0/jquery.countdown.css";&lt;/style&gt; &lt;script type="text/javascript" src="{{ STATIC_URL }}js/jquery.countdown-fr.js"&gt;&lt;/script&gt; &lt;script language="javascript"&gt; var newYear = new Date(); newYear = new Date(newYear.getFullYear() + 1, 1 - 1, 1); $('#defaultCountdown').countdown({until: newYear}); &lt;/script&gt; </code></pre> <p>But nothing appears in my page. What did I do wrong? Is it the good way to include JQuery in my template?</p> <p>I know several questions has been asked about it, but I didn't find how to solve my problem.</p> <p>Any help would be very welcome.</p> <p>Now, I tried:</p> <pre><code>&lt;head&gt; &lt;meta http-equiv="Content-type" content="text/html; charset=utf-8" /&gt; &lt;script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js"&gt;&lt;/script&gt; &lt;style type="text/css"&gt;@import "/Users/marc-antoine.lacroix/Desktop/JQuery/jquery.countdown.package-1.6.0/jquery.countdown.css";&lt;/style&gt; &lt;script type="text/javascript" src="{{ STATIC_URL }}js/jquery.countdown-fr.js"&gt;&lt;/script&gt; &lt;script language="javascript"&gt; $(document).ready(function(){ var newYear = new Date(); newYear = new Date(newYear.getFullYear() + 1, 1 - 1, 1); $('#defaultCountdown').countdown({until: newYear}); }); &lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;div id="defaultCountdown"&gt; &lt;/div&gt; &lt;/body&gt; </code></pre> <p>Still nothing!</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload