AOS template,JSON given to Mustache
by navindian
HTML
<script src="https://github.com/janl/mustache.js/raw/master/mustache.js"></script>
<div id="AOSUSStore"></div>
CSS
div {
font:14px Arial;
margin:50px 20px;
}
JavaScript
$(function () {
var template = '\
\
\
\
{{#products}}\
<p>\
<h3>{{name}}</h3>\
<img src={{{imageURL}}}</img>\
{{#url}}{{/url}}\
{{#first}}<strong>{{/first}}\
{{{description}}}\
{{#first}}</strong>{{/first}}\
{{#url}}</a>{{/url}}\
</p>\
{{/products}}<br />\
';
var json = {
"products":[
"ME324LL/A" : {
"imageURL":"http://store.storeimages.cdn-apple.com/4079/as-images.apple.com/is/image/AppleInc/aos/published/images/2/01/2013/iphone5s/2013-iphone5s-silver?wid=100&hei=100&fmt=png-alpha&qlt=95&.v=1400750408761",
"name":"IPhone 5s",
"description":""
},
"MF046LL/A":{
"imageURL":"http://store.storeimages.cdn-apple.com/4079/as-images.apple.com/is/image/AppleInc/aos/published/images/c/to/cto/iphone5s/cto-iphone5s-case?wid=100&hei=100&align=0,-1&fmt=png-alpha&qlt=95&.v=1400750577548",
"name":"iPhone 5s Case",
"description":"Add another premium leather case for your iPhone. Choose from six colors."
},
"S4575LL/A":{
"imageURL":"http://store.storeimages.cdn-apple.com/4079/as-images.apple.com/is/image/AppleInc/aos/published/images/A/PP/APPLECARE/plus/APPLECARE-plus?wid=100&hei=100&align=0,-1&fmt=png-alpha&qlt=95&.v=1400789529020",
"name":"AppleCare+ for iPhone",
"description":"Every iPhone comes with one year of hardware repair coverage through its limited warranty and up to 90 days of complimentary support. AppleCare+ for iPhone extends your coverage to two years from the original purchase date of your iPhone (1) and adds up to two incidents of accidental damage coverage, each subject to a $79 service fee plus applicable tax. (2) Purchase AppleCare+ together with your new iPhone, and you'll be automatically registered in the...