May 2018
Beginner to intermediate
526 pages
11h 57m
English
We will need to add the AJAX functionality to our image detail template. In order to use jQuery in our templates, we will include it in the base.html template of our project first. Edit the base.html template of the account application and include the following code before the closing </body> HTML tag:
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script><script> $(document).ready(function(){ {% block domready %} {% endblock %} });</script>
We load the jQuery framework from Google's CDN. You can also download jQuery from https://jquery.com/ and add it to the static directory of your application instead.
We add a <script> tag to include JavaScript code. $(document).ready() is a jQuery function ...
Read now
Unlock full access