Browse Source

docs : index : do AJAX jQuery 1.5.1-ish-ly

pull/27/merge
David DeSandro 14 years ago
parent
commit
ac0d53faf3
  1. 2
      css/style.css
  2. 11
      index.html

2
css/style.css

@ -625,6 +625,8 @@ code .nd { color: #9FAD7E; } /* CSS pseudo selector */
background: white;
color: #222;
}
#sites h2.error { color: red; }
#sites ul {
margin: 0;

11
index.html

@ -159,13 +159,20 @@ layout: nil
}
});
var ajaxError = function(){
$sitesTitle.removeClass('loading').addClass('error')
.text('Could not load sites using Isotope :(');
};
// dynamically load sites using Isotope from Ember app
$.getJSON('http://api.emberapp.com/users/view/' +
'desandro/collections/view/isotope.json?callback=?',
function( data ){
'desandro/collections/view/isotope.json?callback=?')
.error( ajaxError )
.success(function( data ){
// proceed only if we have images
if ( !data.response || !data.response.images ) {
ajaxError();
return;
}
var images = data.response.images,

Loading…
Cancel
Save