From the course: Test-Driven Development in Django
Unlock the full course today
Join today to access over 22,400 courses taught by industry experts or purchase this course individually.
AJAX
- [Instructor] To implement our Ajax code, we're going to have to add some JavaScript to our home.html. So first, we need to have a place on the page where we can display the information that comes back from Ajax, so just after our form, let's go ahead and provide an h2 tag here, we'll have the opening, and then a closing h2. To identify this, we're going to go ahead and give this the id that is equal to quickhash, all right? So that's going to start empty, but this is what we're hoping to fill with our Ajax response. So then we need to go ahead and make a script. Now before we make the script, we're going to be using jQuery. So we need to grab jQuery from somewhere. If we go ahead and just Google, jQuery Google API, we can get these hosted libraries from Google, and so there's lots of different places that you could use jQuery, you could just install it, have it locally on your project, but it's best to go ahead and grab this from a certain delivery network, because lots of people…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.