Ejemplo: tutorial de plantilla de jquery
<html>
<head>
<script src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.6.2.min.js"></script>
<script src="http://ajax.aspnetcdn.com/ajax/jquery.templates/beta1/jquery.tmpl.js"></script>
</head>
<body>
<div id="myContent"></div>
<script>
$(document).ready(function() {
$.ajax({
dataType: "jsonp",
url: "replace_with_your_url_that_returns_json",
jsonp: "$callback",
success: showData
});
});
function showData(data) {
// Use the template
$("#myTemplate").tmpl(data).appendTo("#myContent");
}
</script>
<script id="myTemplate" type="text/x-jquery-tmpl">
<div class="profile">
<div class="thumbnail"><img src="${Thumbnail}" alt="" /> </div>
<div>
<span>${Name}</span>
<p>${Bio}</p>
</div>
</div>
</script>
</body>
</html>
¡Haz clic para puntuar esta entrada!
(Votos: 0 Promedio: 0)