Skip to content

Commit

Permalink
added template for jquery templates
Browse files Browse the repository at this point in the history
  • Loading branch information
m.bova committed Sep 17, 2015
1 parent ffde92a commit bf6bcbc
Show file tree
Hide file tree
Showing 8 changed files with 18,050 additions and 0 deletions.
Binary file added 1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added 2.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added 3.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added 4.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10,351 changes: 10,351 additions & 0 deletions jquery-1.11.3.js

Large diffs are not rendered by default.

7,179 changes: 7,179 additions & 0 deletions jquery-1.4.4.js

Large diffs are not rendered by default.

484 changes: 484 additions & 0 deletions jquery.tmpl.js

Large diffs are not rendered by default.

36 changes: 36 additions & 0 deletions templates1.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>Intro</title>
</head>
<body> 
    <div id="pageContent">
        <h1>ASP.NET Bookstore</h1>
        <div id="bookContainer"></div>
    </div>

    <script type="text/javascript" src="jquery-1.4.4.js"></script>
    <script type="text/javascript" src="jquery.tmpl.js"></script>

    <script id="bookTemplate" type="text/x-jQuery-tmpl">
        <div>
            <img src="${picture}" width=50 height=50 alt="" />
            <h2>${title}</h2>
            price: ${price}
        </div>
    </script>

    <script type="text/javascript">
        // Create an array of books
        var books = [
            { title: "ASP.NET 4 Unleashed", price: 37.79, picture: "1.jpg" },
            { title: "ASP.NET MVC Unleashed", price: 44.99, picture: "2.jpg" },
            { title: "ASP.NET Kick Start", price: 4.00, picture: "3.jpg" },
            { title: "ASP.NET MVC Unleashed iPhone", price: 44.99, picture: "4.jpg" },
        ];

        // Render the books using the template
        $("#bookTemplate").tmpl(books).appendTo("#bookContainer"); 
    </script> 
</body>
</html>

0 comments on commit bf6bcbc

Please sign in to comment.