Q:

jquery tooltip and json request help needed

I'm trying to use bassistance jquery tooltip - http://jquery.bassistance.de/tooltip/demo/ and I am attempting to use getJSON to retrieve my tooltip information to display.  But I can't seem to return my results to the tooltip.  Here's the code:
$.('a').tooltip({ 
  delay:0,
  fade:150,
  showURL:false,
  bodyHandler:function() {
    var id = $(this).attr('id');
    $.getJSON('/index.php?option=com_json&format=raw', { task:'tip', tipid:id }, function(a){
      var b = eval(a);
      var c = b['results'];
      //alert(c);
    })
    //return 'hi';
    return c;
  }
});

When I alert "c" inside the json function, it comes back with "hello there" so I know that it's pulling in the right information, but when I try to return "c" (outside the json function) I get the error of c is undefined.  When I return "hi" outside the json request, it displays "hi" as the tooltip.  
If I put return c inside the json function, I get the error "bodyContent is undefined". 
If someone could help me pass my "c" as my tooltip, that would be fantastic :)
Thanks in advance :)

A:

Try:

bodyHandler:function() {
    var id = $(this).attr('id');
    $.getJSON('/index.php?option=com_json&format=raw', { task:'tip', tipid:id }, function(a){
      var c = a.results;
      $("a[id='"+id+"']").html(c);
    })    
    return $($("a[id='"+id+"']").attr("href")).html();
  }

Hope that helps

