Skip to content

Instantly share code, notes, and snippets.

@remotevision
Created October 5, 2013 02:30
Show Gist options
  • Save remotevision/6835894 to your computer and use it in GitHub Desktop.
Save remotevision/6835894 to your computer and use it in GitHub Desktop.
// images = [{ name: 'image name', data: [data or data url] }]
(function($) {
$.imageUrl = function(images, key) {
var imageObject = $.grep(images, function(e){ return e.name == key; });
if(imageObject.length > 0) {
return imageObject[0].data;
} else {
return null;
}
};
})(jQuery);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment