$.widget( "app.serverTime", {
_create: function () {
$.get("/timestamp.php", function( data ) {
this.timestamp = data.timestamp;
})
},
getTime:function() {
return this.timestamp;
}
});
$(".clock").serverTime();
$(".clock").serverTime("getTime")
I have the above jQuery UI Widget when I call the getTime I am getting in the value I am expected but instead I am getting the jQuery Selector, when i set the value manually without using Ajax it works as expected.