jquery template tutorial

Solutions on MaxInterview for jquery template tutorial by the best coders in the world

showing results for - "jquery template tutorial"
Delfina
16 Nov 2016
1<html>
2<head>
3<script src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.6.2.min.js"></script>
4<script src="http://ajax.aspnetcdn.com/ajax/jquery.templates/beta1/jquery.tmpl.js"></script>
5</head>
6
7<body>
8<div id="myContent"></div>
9
10<script>
11$(document).ready(function() {
12$.ajax({
13dataType: "jsonp",
14url: "replace_with_your_url_that_returns_json",
15jsonp: "$callback",
16success: showData
17});
18});
19
20function showData(data) {
21// Use the template
22$("#myTemplate").tmpl(data).appendTo("#myContent");
23}
24</script>
25
26<script id="myTemplate" type="text/x-jquery-tmpl">
27<div class="profile">
28<div class="thumbnail"><img src="${Thumbnail}" alt="" /> </div>
29<div>
30<span>${Name}</span>
31<p>${Bio}</p>
32</div>
33</div>
34</script>
35</body>
36</html>