Skip to content

Commit

Permalink
dealing with undefined attributes, using explicit obj reference in te…
Browse files Browse the repository at this point in the history
…mplate in docs
  • Loading branch information
eikes committed Sep 7, 2011
1 parent cff730b commit f722996
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions index.html
Expand Up @@ -125,7 +125,6 @@ <h2>This JS lib lets you filter, sort and display large datasets in the browser.
"imageURL": "http://flickholdr.iwerk.org/150/100/Lion/1",
"description": "Ut Takimata Sit Aliquyam Labore Aliquyam Sit Sit Lorem Amet. Ipsum Rebum. ",
"category": "Lion",
"language": "Lisp",
"continent": "North America"
},
...
Expand All @@ -149,12 +148,14 @@ <h2>Demo</h2>
$(function(){
var item_template =
'<div class="item">' +
'<img src="<%= imageURL %>">' +
'<h4><%= lastname %>, <%= firstname %></h4>' +
'<img src="<%= obj.imageURL %>">' +
'<h4><%= obj.lastname %>, <%= obj.firstname %></h4>' +
'<p class="tags">' +
'<%= category %>, <%= continent %>, <%= language %>' +
'<% if (obj.category) { %><%= obj.category %><% } %>' +
'<% if (obj.continent) { %>, <%= obj.continent %><% } %>' +
'<% if (obj.language) { %>, <%= obj.language %><% } %>' +
'</p>' +
'<p class="desc"><%= description %></p>' +
'<p class="desc"><%= obj.description %></p>' +
'</div>';
settings = {
items : example_items,
Expand Down Expand Up @@ -325,7 +326,6 @@ <h2>Demo</h2>
"imageURL": "http://flickholdr.iwerk.org/150/100/Horse/15",
"description": "Sed Est Sea Et Dolores Sea Dolores ",
"category": "Horse",
"language": "Basic",
"continent": "South America"
},
{
Expand Down Expand Up @@ -1155,12 +1155,14 @@ <h3>Example Code</h3>
}];
var item_template =
'&lt;div class="item">' +
'&lt;img src="&lt;%= imageURL %>">' +
'&lt;h4>&lt;%= lastname %>, &lt;%= firstname %>&lt;/h4>' +
'&lt;p class="desc">&lt;%= description %>&lt;/p>' +
'&lt;img src="&lt;%= obj.imageURL %>">' +
'&lt;h4>&lt;%= obj.lastname %>, &lt;%= obj.firstname %>&lt;/h4>' +
'&lt;p class="tags">' +
'&lt;%= category %>, &lt;%= continent %>, &lt;%= language %>' +
'&lt;% if (obj.category) { %>&lt;%= obj.category %>&lt;% } %>' +
'&lt;% if (obj.continent) { %>, &lt;%= obj.continent %>&lt;% } %>' +
'&lt;% if (obj.language) { %>, &lt;%= obj.language %>&lt;% } %>' +
'&lt;/p>' +
'&lt;p class="desc">&lt;%= obj.description %>&lt;/p>' +
'&lt;/div>';
var settings = {
items : example_items,
Expand Down

0 comments on commit f722996

Please sign in to comment.