O'Reilly logo

Web Development with Clojure by Dmitri Sotnikov

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

Putting It All Together

Let’s look at an example of a service that has a couple of resources that allow the client to read and store some data.

The application will display a list of users and allow the client to add additional users to the list. The client will be implemented in JavaScript and use Ajax to communicate with the service.

To start, let’s create a static HTML page in our public directory and call it home.html. The page contents will look like this:

liberator-snippets/home.html
 
<html>
 
<head>
 
<title>​Liberator Example​</title>
 
<script​ type=​"text/javascript"
 
src=​"//ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js"​​>
 
</script>
 
 
<script​ type=​"text/javascript"​​>
 
function renderUsers(users) ...

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