Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
        <meta name="viewport" content="width=device-width">
        <title>Snoopy demo</title>
    </head>
    <body>
        <ul id="shopping-list"></ul>
        <!-- include jQuery, Snoopy -->
        <script src="https://code.jquery.com/jquery-2.2.4.js"></script>
        <script src="http://daniel-hug.github.io/snoopy/snoopy.js"></script>
    </body>
</html>
 
var $shoppingList = $('#shopping-list');
function renderItem(item) {
    var $li = $('<li>');
    item.snoop('title quantity', function(title, quantity) {
        $li.text(title + ': buy ' + quantity);
    });
    $shoppingList.append($li);
}
var eggs = new Snoopy({
    title: 'eggs',
    quantity: '1 dozen'
});
renderItem(eggs);
Output

You can jump to the latest bin by adding /latest to your URL

Dismiss x