With the rise in popularity of the Internet, sites are becoming more and more interesting and complex. Simply showing the site content or redirecting users to other, required pages are already antiquated methods. The modern user is an experienced consumer. To keep users on your site, you need to keep them interested by providing friendly interfaces. In particular, one of the best technologies we can use is dynamic, new content loading by certain user actions instead of reloading the whole page. By this, we mean AJAX. In this recipe, we will look into how to use the HTML snippets together with the Volt Template Engine in an application which uses AJAX requests.
We will take a look at a small application that works with customers and orders. We will implement a page where you can select a customer and see the last 10 orders of that customer.