Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
<script src="http://cdnjs.cloudflare.com/ajax/libs/zepto/1.0/zepto.min.js"></script>
<meta charset=utf-8 />
<title>JS Bin</title>
</head>
<body>
  <button id="silly">Do It</button>
    <button id="clear">Clear</button>
    <div id="results"></div>
      <script>
        /*
    var SILLY = (function (module) {
      
      module.DoIt = function (resultObject) {
          resultObject.prepend(Date() + '<br>');
      };
      
      return module;
    } (SILLY || (new Object())));
    */
        
        var SILLY = (function() {
          
          if (SILLY === undefined) {
            var SILLY = new Object();
            SILLY.DoIt = function (resultObject) {
                resultObject.prepend(Date() + '<br>');
            };
          }
          return SILLY;    
        }());
      
  </script>
  
  <script>
        $('#silly').click(function () {
            SILLY.DoIt($('#results'));
        });
        $('#clear').click(function () {
            $('#results').html('');
        });
    </script>
</body>
</html>
Output

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

Dismiss x
public
Bin info
theacadianpro
0viewers