Test jquery templates

HTML

<script src="http://ajax.microsoft.com/ajax/jquery.templates/beta1/jquery.tmpl.min.js"></script>
<script id="testTemplate" type="text/x-jquery-tmpl">
    {{if title.length}}
    <h3>${title}</h3>
    <p>Start: ${ htmlDetail() } :End</p>
    {{/if}}
</script>

<div id="bookList"></div>

JavaScript

function htmlDetail(){
    return "hello <strong>world</strong>"; 
}

var book = [
    { title: "Goodnight, World!",
      detail: { author: "Jojo Mojo", synopsis : "What the ..." }},
    { title: "Rainbow",
      detail: { author: "Cookie", synopsis : "Huh?" }}
];

$("#testTemplate").tmpl(book).appendTo("#bookList");