Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $('.mixingroom-impatient a').live('click', function(){
- var listItems = getAllRecipes();
- console.log(listItems);
- });
- function getAllRecipes() {
- var listItems;
- $.getJSON('/allrecipes', function(data){
- var recipes = [];
- $.each(data, function(i, item){
- var recipeTitle = item.recipe.title;
- var recipeThumb = item.recipe.image_file_name;
- var recipeID = item.recipe.id;
- recipes.push('<li><a href="#' + recipeID + '" style="background-image:url(/system/images/' + recipeID + '/thumb/' + recipeThumb + ');">' + recipeTitle + '</a></li>');
- });
- listItems = recipes.join('');
- });
- return listItems;
- }
Add Comment
Please, Sign In to add comment