Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8 />
<title>JS Bin</title>
</head>
<body>
  
</body>
</html>
 
var g = {};
function prepare()
{
  $('*[data-module-load]').each(function()
  {
    g.module = {};
    if( typeof window[$(this).attr('data-module-load')] === 'object' )
        {
            g.module = window[$(this).attr('data-module-load')];
            if( typeof g.module.foo === 'function' )
            {
                g.module.foo();
            }
        }
  });
}
                                
function feedback( message , force )
{
  if( !force )
  {
    setTimeout(function()
    {
      feedback( message, true );
    } , 1000 );
  }
  else
  {
    console.log( message );
  }
}
var my_obj =
{
    foo:function()
    {
      $.ajax(
      {
        url:'/',
        success:function(d,t)
        {
          this.bar();
        }
      });
    },
    bar:function()
    {
      feedback('hello world!');
    }
};
$(document).ready(function()
{
  prepare();
});
Output

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

Dismiss x
public
Bin info
anonymouspro
0viewers