O'Reilly logo

Learning Django Web Development by Ratan Kumar, Sanjeev Jaiswal

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Implementing the live searching of tweets

As we conducted a simple search in the previous section, we will now implement the live search, which is technically the same, but the only difference is that the search form will be submitted with every key stroke and the results will be loaded in real, time.

To implement live searches, we need to do the following two things:

  • We need to intercept and handle the event of submitting the search form. This can be done using the submit() method of jQuery.
  • We need to use AJAX to load the search results in the background and insert them in the page.

jQuery offers a method called load() that retrieves a page from the server and inserts its contents into the selected element. In its simplest form, the function takes ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required