Skip to content

Instantly share code, notes, and snippets.

@adomado
Created April 12, 2011 08:24
Show Gist options
  • Save adomado/915168 to your computer and use it in GitHub Desktop.
Save adomado/915168 to your computer and use it in GitHub Desktop.
var Foo = {
init : function() {
Foo.getLocation(Foo.showLocation, this);
},
showLocation : function(data) {
console.log("In showLocation callback => " + JSON.stringify(data));
},
getLocation : function (callback){
console.log("fetch guest data from server");
$j.ajax({
url: 'http://jsonip.com/',
type: 'post',
dataType: 'json',
success: callback
});
},
};
Foo.init();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment